aboutsummaryrefslogtreecommitdiff
path: root/src/mail/uidindex.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/mail/uidindex.rs')
-rw-r--r--src/mail/uidindex.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mail/uidindex.rs b/src/mail/uidindex.rs
index 7160ec6..736c763 100644
--- a/src/mail/uidindex.rs
+++ b/src/mail/uidindex.rs
@@ -36,6 +36,7 @@ pub enum UidIndexOp {
MailDel(UniqueIdent),
FlagAdd(UniqueIdent, Vec<Flag>),
FlagDel(UniqueIdent, Vec<Flag>),
+ BumpUidvalidity(u32),
}
impl UidIndex {
@@ -59,6 +60,11 @@ impl UidIndex {
UidIndexOp::FlagDel(ident, flags)
}
+ #[must_use]
+ pub fn op_bump_uidvalidity(&self, count: u32) -> UidIndexOp {
+ UidIndexOp::BumpUidvalidity(count)
+ }
+
// INTERNAL functions to keep state consistent
fn reg_email(&mut self, ident: UniqueIdent, uid: ImapUid, flags: &Vec<Flag>) {
@@ -156,6 +162,9 @@ impl BayouState for UidIndex {
new.idx_by_flag.remove(*uid, rm_flags);
}
}
+ UidIndexOp::BumpUidvalidity(count) => {
+ new.uidvalidity = ImapUidvalidity::new(new.uidvalidity.get() + *count).unwrap_or(ImapUidvalidity::new(u32::MAX).unwrap());
+ }
}
new
}