aboutsummaryrefslogtreecommitdiff
path: root/aero-proto/imap/flags.rs
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2024-03-08 09:55:33 +0100
committerQuentin Dufour <quentin@deuxfleurs.fr>2024-03-08 09:55:33 +0100
commit11462f80c4ae25696c7436ed7aacb92074d7e911 (patch)
tree333677df5ea981b0e1468b43fc00df9d242ad4fa /aero-proto/imap/flags.rs
parent1edf0b15ecaa73d55bb72c6f3c6e25d4f231f322 (diff)
downloadaerogramme-11462f80c4ae25696c7436ed7aacb92074d7e911.tar.gz
aerogramme-11462f80c4ae25696c7436ed7aacb92074d7e911.zip
Re-enable proto
Diffstat (limited to 'aero-proto/imap/flags.rs')
-rw-r--r--aero-proto/imap/flags.rs30
1 files changed, 0 insertions, 30 deletions
diff --git a/aero-proto/imap/flags.rs b/aero-proto/imap/flags.rs
deleted file mode 100644
index 0f6ec64..0000000
--- a/aero-proto/imap/flags.rs
+++ /dev/null
@@ -1,30 +0,0 @@
-use imap_codec::imap_types::core::Atom;
-use imap_codec::imap_types::flag::{Flag, FlagFetch};
-
-pub fn from_str(f: &str) -> Option<FlagFetch<'static>> {
- match f.chars().next() {
- Some('\\') => match f {
- "\\Seen" => Some(FlagFetch::Flag(Flag::Seen)),
- "\\Answered" => Some(FlagFetch::Flag(Flag::Answered)),
- "\\Flagged" => Some(FlagFetch::Flag(Flag::Flagged)),
- "\\Deleted" => Some(FlagFetch::Flag(Flag::Deleted)),
- "\\Draft" => Some(FlagFetch::Flag(Flag::Draft)),
- "\\Recent" => Some(FlagFetch::Recent),
- _ => match Atom::try_from(f.strip_prefix('\\').unwrap().to_string()) {
- Err(_) => {
- tracing::error!(flag=%f, "Unable to encode flag as IMAP atom");
- None
- }
- Ok(a) => Some(FlagFetch::Flag(Flag::system(a))),
- },
- },
- Some(_) => match Atom::try_from(f.to_string()) {
- Err(_) => {
- tracing::error!(flag=%f, "Unable to encode flag as IMAP atom");
- None
- }
- Ok(a) => Some(FlagFetch::Flag(Flag::keyword(a))),
- },
- None => None,
- }
-}