aboutsummaryrefslogtreecommitdiff
path: root/src/imap
diff options
context:
space:
mode:
Diffstat (limited to 'src/imap')
-rw-r--r--src/imap/capability.rs8
-rw-r--r--src/imap/command/authenticated.rs5
-rw-r--r--src/imap/mailbox_view.rs8
3 files changed, 16 insertions, 5 deletions
diff --git a/src/imap/capability.rs b/src/imap/capability.rs
index be1d4b6..37f14df 100644
--- a/src/imap/capability.rs
+++ b/src/imap/capability.rs
@@ -11,9 +11,11 @@ fn capability_condstore() -> Capability<'static> {
Capability::try_from("CONDSTORE").unwrap()
}
+/*
fn capability_qresync() -> Capability<'static> {
Capability::try_from("QRESYNC").unwrap()
}
+*/
#[derive(Debug, Clone)]
pub struct ServerCapability(HashSet<Capability<'static>>);
@@ -84,10 +86,14 @@ impl ClientCapability {
}
}
+ pub fn enable_condstore(&mut self) {
+ self.condstore = self.condstore.enable();
+ }
+
pub fn select_enable(&mut self, atoms: &[Atom]) {
for at in atoms.iter() {
if at.as_ref().to_uppercase() == "CONDSTORE" {
- self.condstore = self.condstore.enable();
+ self.enable_condstore();
}
}
}
diff --git a/src/imap/command/authenticated.rs b/src/imap/command/authenticated.rs
index f083ac8..da41182 100644
--- a/src/imap/command/authenticated.rs
+++ b/src/imap/command/authenticated.rs
@@ -311,8 +311,9 @@ impl<'a> AuthenticatedContext<'a> {
bail!("quota not implemented, can't return freed storage after EXPUNGE will be run");
},
StatusDataItemName::HighestModSeq => {
- bail!("highestmodseq not yet implemented");
- }
+ self.client_capabilities.enable_condstore();
+ StatusDataItem::HighestModSeq(view.highestmodseq().get())
+ },
});
}
diff --git a/src/imap/mailbox_view.rs b/src/imap/mailbox_view.rs
index a3d56f0..b3848b2 100644
--- a/src/imap/mailbox_view.rs
+++ b/src/imap/mailbox_view.rs
@@ -15,7 +15,7 @@ use imap_codec::imap_types::sequence::SequenceSet;
use crate::mail::mailbox::Mailbox;
use crate::mail::query::QueryScope;
use crate::mail::snapshot::FrozenMailbox;
-use crate::mail::uidindex::{ImapUid, ImapUidvalidity};
+use crate::mail::uidindex::{ImapUid, ImapUidvalidity, ModSeq};
use crate::imap::attributes::AttributesProxy;
use crate::imap::flags;
@@ -399,11 +399,15 @@ impl MailboxView {
pub(crate) fn highestmodseq_status(&self) -> Result<Body<'static>> {
Ok(Body::Status(Status::ok(
None,
- Some(Code::Other(CodeOther::unvalidated(format!("HIGHESTMODSEQ {}", self.internal.snapshot.highestmodseq).into_bytes()))),
+ Some(Code::Other(CodeOther::unvalidated(format!("HIGHESTMODSEQ {}", self.highestmodseq()).into_bytes()))),
"Highest",
)?))
}
+ pub(crate) fn highestmodseq(&self) -> ModSeq {
+ self.internal.snapshot.highestmodseq
+ }
+
/// Produce an EXISTS message corresponding to the number of mails
/// in `known_state`
fn exists_status(&self) -> Result<Body<'static>> {