aboutsummaryrefslogtreecommitdiff
path: root/src/mail/mailbox.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-07-13 11:00:35 +0200
committerAlex Auvolat <alex@adnab.me>2022-07-13 11:00:35 +0200
commita1ca6d9defc844fee52d966951701a57727050c7 (patch)
treefaccf61f4f882dc05f3812655bb6f58bde79b725 /src/mail/mailbox.rs
parent7959adb8e970c9006ea9799b5ddd6b2c9aac217a (diff)
downloadaerogramme-a1ca6d9defc844fee52d966951701a57727050c7.tar.gz
aerogramme-a1ca6d9defc844fee52d966951701a57727050c7.zip
"set flags" as a bayou op
Diffstat (limited to 'src/mail/mailbox.rs')
-rw-r--r--src/mail/mailbox.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/mail/mailbox.rs b/src/mail/mailbox.rs
index 0e8af70..4b84cf2 100644
--- a/src/mail/mailbox.rs
+++ b/src/mail/mailbox.rs
@@ -95,6 +95,11 @@ impl Mailbox {
self.mbox.write().await.del_flags(id, flags).await
}
+ /// Define the new flags for this message
+ pub async fn set_flags<'a>(&self, id: UniqueIdent, flags: &[Flag]) -> Result<()> {
+ self.mbox.write().await.set_flags(id, flags).await
+ }
+
/// Insert an email into the mailbox
pub async fn append<'a>(
&self,
@@ -265,6 +270,11 @@ impl MailboxInternal {
self.uid_index.push(del_flag_op).await
}
+ async fn set_flags(&mut self, ident: UniqueIdent, flags: &[Flag]) -> Result<()> {
+ let set_flag_op = self.uid_index.state().op_flag_set(ident, flags.to_vec());
+ self.uid_index.push(set_flag_op).await
+ }
+
async fn append(
&mut self,
mail: IMF<'_>,