From a2d6efc962dbf5de64a70cf7d9f293534bd5369a Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Wed, 10 Jan 2024 11:24:01 +0100 Subject: [broken compilation] update mail internal --- src/mail/mailbox.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/mail/mailbox.rs') diff --git a/src/mail/mailbox.rs b/src/mail/mailbox.rs index aab200b..84fa5af 100644 --- a/src/mail/mailbox.rs +++ b/src/mail/mailbox.rs @@ -113,7 +113,7 @@ impl Mailbox { msg: IMF<'a>, ident: Option, 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, 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!( @@ -476,7 +476,7 @@ fn dump(uid_index: &Bayou) { "{} {} {}", uid, hex::encode(ident.0), - s.table.get(ident).cloned().unwrap().1.join(", ") + s.table.get(ident).cloned().unwrap().2.join(", ") ); } println!(); -- cgit v1.2.3 From 9cec7803d28617f1bfd1ac1621c2eda9582201d4 Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Wed, 10 Jan 2024 17:07:07 +0100 Subject: Implement HIGHESTMODSEQ for STATUS --- src/mail/mailbox.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/mail/mailbox.rs') diff --git a/src/mail/mailbox.rs b/src/mail/mailbox.rs index 84fa5af..5e95f32 100644 --- a/src/mail/mailbox.rs +++ b/src/mail/mailbox.rs @@ -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) { let s = uid_index.state(); println!("---- MAILBOX STATE ----"); -- cgit v1.2.3