aboutsummaryrefslogtreecommitdiff
path: root/src/imap
diff options
context:
space:
mode:
Diffstat (limited to 'src/imap')
-rw-r--r--src/imap/command/authenticated.rs8
-rw-r--r--src/imap/index.rs2
-rw-r--r--src/imap/mailbox_view.rs6
3 files changed, 8 insertions, 8 deletions
diff --git a/src/imap/command/authenticated.rs b/src/imap/command/authenticated.rs
index 5af8e98..f083ac8 100644
--- a/src/imap/command/authenticated.rs
+++ b/src/imap/command/authenticated.rs
@@ -507,7 +507,7 @@ impl<'a> AuthenticatedContext<'a> {
) -> Result<(Response<'static>, flow::Transition)> {
let append_tag = self.req.tag.clone();
match self.append_internal(mailbox, flags, date, message).await {
- Ok((_mb, uidvalidity, uid)) => Ok((
+ Ok((_mb, uidvalidity, uid, _modseq)) => Ok((
Response::build()
.tag(append_tag)
.message("APPEND completed")
@@ -548,7 +548,7 @@ impl<'a> AuthenticatedContext<'a> {
flags: &[Flag<'a>],
date: &Option<DateTime>,
message: &Literal<'a>,
- ) -> Result<(Arc<Mailbox>, ImapUidvalidity, ImapUidvalidity)> {
+ ) -> Result<(Arc<Mailbox>, ImapUidvalidity, ImapUid, ModSeq)> {
let name: &str = MailboxName(mailbox).try_into()?;
let mb_opt = self.user.open_mailbox(&name).await?;
@@ -566,9 +566,9 @@ impl<'a> AuthenticatedContext<'a> {
let flags = flags.iter().map(|x| x.to_string()).collect::<Vec<_>>();
// TODO: filter allowed flags? ping @Quentin
- let (uidvalidity, uid) = mb.append(msg, None, &flags[..]).await?;
+ let (uidvalidity, uid, modseq) = mb.append(msg, None, &flags[..]).await?;
- Ok((mb, uidvalidity, uid))
+ Ok((mb, uidvalidity, uid, modseq))
}
}
diff --git a/src/imap/index.rs b/src/imap/index.rs
index 4853374..95c16b3 100644
--- a/src/imap/index.rs
+++ b/src/imap/index.rs
@@ -21,7 +21,7 @@ impl<'a> Index<'a> {
.table
.get(&uuid)
.ok_or(anyhow!("mail is missing from index"))?
- .1
+ .2
.as_ref();
let i_int: u32 = (i_enum + 1).try_into()?;
let i: NonZeroU32 = i_int.try_into()?;
diff --git a/src/imap/mailbox_view.rs b/src/imap/mailbox_view.rs
index 046acfa..90cfc70 100644
--- a/src/imap/mailbox_view.rs
+++ b/src/imap/mailbox_view.rs
@@ -108,7 +108,7 @@ impl MailboxView {
let old_mail = old_snapshot.table.get(uuid);
let new_mail = new_snapshot.table.get(uuid);
if old_mail.is_some() && old_mail != new_mail {
- if let Some((uid, flags)) = new_mail {
+ if let Some((uid, _modseq, flags)) = new_mail {
data.push(Body::Data(Data::Fetch {
seq: NonZeroU32::try_from((i + 1) as u32).unwrap(),
items: vec![
@@ -185,7 +185,7 @@ impl MailboxView {
let msgs = state
.table
.iter()
- .filter(|(_uuid, (_uid, flags))| flags.iter().any(|x| *x == deleted_flag))
+ .filter(|(_uuid, (_uid, _modseq, flags))| flags.iter().any(|x| *x == deleted_flag))
.map(|(uuid, _)| *uuid);
for msg in msgs {
@@ -438,7 +438,7 @@ impl MailboxView {
.table
.values()
.enumerate()
- .find(|(_i, (_imap_uid, flags))| !flags.contains(&"\\Seen".to_string()))
+ .find(|(_i, (_imap_uid, _modseq, flags))| !flags.contains(&"\\Seen".to_string()))
.map(|(i, _)| NonZeroU32::try_from(i as u32 + 1))
.transpose()?)
}