From f41a1ffe3abb607ea50d86cf687099dad920f717 Mon Sep 17 00:00:00 2001 From: Manos Pitsidianakis Date: Sun, 26 Jul 2020 01:10:11 +0300 Subject: [PATCH] imap: remove FLAGS.SILENT from STOREs Flag updates were not received, because FLAGS.SILENT was used. --- melib/src/backends/imap.rs | 10 +++++----- melib/src/backends/imap/protocol_parser.rs | 1 - 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/melib/src/backends/imap.rs b/melib/src/backends/imap.rs index 945adfca..aec553b4 100644 --- a/melib/src/backends/imap.rs +++ b/melib/src/backends/imap.rs @@ -504,7 +504,7 @@ impl MailBackend for ImapType { for env_hash in env_hashes.rest { cmd = format!("{},{}", cmd, hash_index_lck[&env_hash].0); } - format!("{} +FLAGS.SILENT (\\Deleted)", cmd) + format!("{} +FLAGS (\\Deleted)", cmd) }; conn.send_command(command.as_bytes()).await?; conn.read_response(&mut response, RequiredResponses::empty()) @@ -535,7 +535,7 @@ impl MailBackend for ImapType { for env_hash in &env_hashes.rest { cmd = format!("{},{}", cmd, hash_index_lck[env_hash].0); } - cmd = format!("{} +FLAGS.SILENT (", cmd); + cmd = format!("{} +FLAGS (", cmd); for (f, v) in flags.iter() { if !*v { continue; @@ -579,7 +579,7 @@ impl MailBackend for ImapType { cmd }; conn.send_command(command.as_bytes()).await?; - conn.read_response(&mut response, RequiredResponses::STORE_REQUIRED) + conn.read_response(&mut response, RequiredResponses::empty()) .await?; } if flags.iter().any(|(_, b)| !*b) { @@ -590,7 +590,7 @@ impl MailBackend for ImapType { for env_hash in &env_hashes.rest { cmd = format!("{},{}", cmd, hash_index_lck[env_hash].0); } - cmd = format!("{} -FLAGS.SILENT (", cmd); + cmd = format!("{} -FLAGS (", cmd); for (f, v) in flags.iter() { if *v { continue; @@ -634,7 +634,7 @@ impl MailBackend for ImapType { cmd }; conn.send_command(command.as_bytes()).await?; - conn.read_response(&mut response, RequiredResponses::STORE_REQUIRED) + conn.read_response(&mut response, RequiredResponses::empty()) .await?; } Ok(()) diff --git a/melib/src/backends/imap/protocol_parser.rs b/melib/src/backends/imap/protocol_parser.rs index f6e8bf52..e3d904bf 100644 --- a/melib/src/backends/imap/protocol_parser.rs +++ b/melib/src/backends/imap/protocol_parser.rs @@ -59,7 +59,6 @@ bitflags! { const LIST_REQUIRED = Self::LIST.bits; const LSUB_REQUIRED = Self::LSUB.bits; const FETCH_REQUIRED = Self::FETCH.bits; - const STORE_REQUIRED = Self::FETCH.bits; } }