aboutsummaryrefslogtreecommitdiff
path: root/src/imap
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2024-01-19 16:47:20 +0100
committerQuentin Dufour <quentin@deuxfleurs.fr>2024-01-19 16:47:20 +0100
commit0cc38571f494a40170dc9913eddad5012337574a (patch)
tree4f5bc045d33b97ed096775818d30a77f50c89df2 /src/imap
parent0f227e44e4996e54d2e55ed5c7a07f5458c4db4f (diff)
downloadaerogramme-0cc38571f494a40170dc9913eddad5012337574a.tar.gz
aerogramme-0cc38571f494a40170dc9913eddad5012337574a.zip
Implement some part of SPECIAL-USE
Diffstat (limited to 'src/imap')
-rw-r--r--src/imap/command/authenticated.rs12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/imap/command/authenticated.rs b/src/imap/command/authenticated.rs
index 3fd132f..c5f2d00 100644
--- a/src/imap/command/authenticated.rs
+++ b/src/imap/command/authenticated.rs
@@ -235,11 +235,19 @@ impl<'a> AuthenticatedContext<'a> {
.to_string()
.try_into()
.map_err(|_| anyhow!("invalid mailbox name"))?;
- let mut items = vec![FlagNameAttribute::try_from(Atom::unvalidated(
+ let mut items = vec![FlagNameAttribute::from(Atom::unvalidated(
"Subscribed",
- ))?];
+ ))];
if !*is_real {
items.push(FlagNameAttribute::Noselect);
+ } else {
+ match *mb {
+ "Drafts" => items.push(Atom::unvalidated("Drafts").into()),
+ "Archive" => items.push(Atom::unvalidated("Archive").into()),
+ "Sent" => items.push(Atom::unvalidated("Sent").into()),
+ "Trash" => items.push(Atom::unvalidated("Trash").into()),
+ _ => (),
+ };
}
if is_lsub {
ret.push(Data::Lsub {