From d737e33b5ac4a09ada10de70b78b866481d69cba Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Wed, 29 Jun 2022 15:52:09 +0200 Subject: Rename MailIdent to UniqueIdent and use those to identify mailboxes --- src/imap/mailbox_view.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/imap') diff --git a/src/imap/mailbox_view.rs b/src/imap/mailbox_view.rs index ec5580d..d03538f 100644 --- a/src/imap/mailbox_view.rs +++ b/src/imap/mailbox_view.rs @@ -8,7 +8,7 @@ use imap_codec::types::flag::Flag; use imap_codec::types::mailbox::{ListMailbox, Mailbox as MailboxCodec}; use imap_codec::types::response::{Code, Data, Status}; -use crate::mail::mailbox::{Mailbox, Summary}; +use crate::mail::mailbox::Mailbox; use crate::mail::uidindex::UidIndex; const DEFAULT_FLAGS: [Flag; 5] = [ @@ -35,6 +35,7 @@ impl MailboxView { /// Creates a new IMAP view into a mailbox. /// Generates the necessary IMAP messages so that the client /// has a satisfactory summary of the current mailbox's state. + /// These are the messages that are sent in response to a SELECT command. pub async fn new(mailbox: Arc) -> Result<(Self, Vec)> { let state = mailbox.current_uid_index().await; @@ -140,7 +141,11 @@ impl MailboxView { }) .flatten() .collect(); - flags.extend_from_slice(&DEFAULT_FLAGS); + for f in DEFAULT_FLAGS.iter() { + if !flags.contains(f) { + flags.push(f.clone()); + } + } let mut ret = vec![Body::Data(Data::Flags(flags.clone()))]; flags.push(Flag::Permanent); -- cgit v1.2.3