diff options
author | Quentin <quentin@dufour.io> | 2024-01-15 07:07:06 +0000 |
---|---|---|
committer | Quentin <quentin@dufour.io> | 2024-01-15 07:07:06 +0000 |
commit | 55e26d24a08519ded6a6898453dcd6db287f45c8 (patch) | |
tree | 074d9f8dbc161d2aa8f59be26826b40c09d3d658 /src/mail/mailbox.rs | |
parent | d49a2355f71fe555a67a815c31800f901a0d0a71 (diff) | |
parent | 81bfed3b7df354148f284ed4e3708c1a086d6e58 (diff) | |
download | aerogramme-55e26d24a08519ded6a6898453dcd6db287f45c8.tar.gz aerogramme-55e26d24a08519ded6a6898453dcd6db287f45c8.zip |
Merge pull request 'CONDSTORE' (#71) from feat/condstore-try-2 into main
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/aerogramme/pulls/71
Diffstat (limited to 'src/mail/mailbox.rs')
-rw-r--r-- | src/mail/mailbox.rs | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/mail/mailbox.rs b/src/mail/mailbox.rs index aab200b..5e95f32 100644 --- a/src/mail/mailbox.rs +++ b/src/mail/mailbox.rs @@ -113,7 +113,7 @@ impl Mailbox { msg: IMF<'a>, ident: Option<UniqueIdent>, flags: &[Flag], - ) -> Result<(ImapUidvalidity, ImapUid)> { + ) -> Result<(ImapUidvalidity, ImapUid, ModSeq)> { self.mbox.write().await.append(msg, ident, flags).await } @@ -271,7 +271,7 @@ impl MailboxInternal { mail: IMF<'_>, ident: Option<UniqueIdent>, flags: &[Flag], - ) -> Result<(ImapUidvalidity, ImapUid)> { + ) -> Result<(ImapUidvalidity, ImapUid, ModSeq)> { let ident = ident.unwrap_or_else(gen_ident); let message_key = gen_key(); @@ -312,14 +312,14 @@ impl MailboxInternal { let add_mail_op = uid_state.op_mail_add(ident, flags.to_vec()); let uidvalidity = uid_state.uidvalidity; - let uid = match add_mail_op { - UidIndexOp::MailAdd(_, uid, _) => uid, + let (uid, modseq) = match add_mail_op { + UidIndexOp::MailAdd(_, uid, modseq, _) => (uid, modseq), _ => unreachable!(), }; self.uid_index.push(add_mail_op).await?; - Ok((uidvalidity, uid)) + Ok((uidvalidity, uid, modseq)) } async fn append_from_s3<'a>( @@ -432,7 +432,7 @@ impl MailboxInternal { .table .get(&source_id) .ok_or(anyhow!("Source mail not found"))? - .1 + .2 .clone(); futures::try_join!( @@ -465,6 +465,9 @@ impl MailboxInternal { } } +// Can be useful to debug so we want this code +// to be available to developers +#[allow(dead_code)] fn dump(uid_index: &Bayou<UidIndex>) { let s = uid_index.state(); println!("---- MAILBOX STATE ----"); @@ -476,7 +479,7 @@ fn dump(uid_index: &Bayou<UidIndex>) { "{} {} {}", uid, hex::encode(ident.0), - s.table.get(ident).cloned().unwrap().1.join(", ") + s.table.get(ident).cloned().unwrap().2.join(", ") ); } println!(); |