From fe03e2de678e45977f3e36e41f3220af6a77df51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20DOUIN?= Date: Wed, 4 Mar 2026 11:23:18 +0100 Subject: [PATCH] use uid by default over seq --- src/imap/envelope/command/get.rs | 8 ++++---- src/imap/envelope/command/list.rs | 8 ++++---- src/imap/envelope/command/search.rs | 8 ++++---- src/imap/envelope/command/sort.rs | 8 ++++---- src/imap/envelope/command/thread.rs | 10 +++++----- src/imap/flag/command/add.rs | 6 +++--- src/imap/flag/command/remove.rs | 6 +++--- src/imap/flag/command/set.rs | 6 +++--- 8 files changed, 30 insertions(+), 30 deletions(-) diff --git a/src/imap/envelope/command/get.rs b/src/imap/envelope/command/get.rs index 42062d2a..1e57023b 100644 --- a/src/imap/envelope/command/get.rs +++ b/src/imap/envelope/command/get.rs @@ -33,13 +33,13 @@ pub struct GetEnvelopeCommand { #[command(flatten)] pub mailbox: MailboxNameOptionalFlag, - /// The message sequence number or UID. + /// The message UID (or sequence number with --seq). #[arg(name = "id", value_name = "ID")] pub id: u32, - /// Use UID FETCH instead of FETCH. + /// Use sequence numbers instead of UIDs. #[arg(long)] - pub uid: bool, + pub seq: bool, } impl GetEnvelopeCommand { @@ -68,7 +68,7 @@ impl GetEnvelopeCommand { ]); let mut arg = None; - let mut coroutine = ImapFetchFirst::new(context, id, item_names, self.uid); + let mut coroutine = ImapFetchFirst::new(context, id, item_names, !self.seq); let items = loop { match coroutine.resume(arg.take()) { diff --git a/src/imap/envelope/command/list.rs b/src/imap/envelope/command/list.rs index c53b639d..3bf7f800 100644 --- a/src/imap/envelope/command/list.rs +++ b/src/imap/envelope/command/list.rs @@ -46,9 +46,9 @@ pub struct ListEnvelopesCommand { #[arg(short, long, default_value = "1:*")] pub sequence: String, - /// Use UID FETCH instead of FETCH. + /// Use sequence numbers instead of UIDs. #[arg(long)] - pub uid: bool, + pub seq: bool, } impl ListEnvelopesCommand { @@ -77,7 +77,7 @@ impl ListEnvelopesCommand { MacroOrMessageDataItemNames::MessageDataItemNames(vec![MessageDataItemName::Envelope]); let mut arg = None; - let mut coroutine = ImapFetch::new(context, sequence_set, item_names, self.uid); + let mut coroutine = ImapFetch::new(context, sequence_set, item_names, !self.seq); let data = loop { match coroutine.resume(arg.take()) { @@ -87,7 +87,7 @@ impl ListEnvelopesCommand { } }; - let table = EnvelopesTable::new(data, self.uid); + let table = EnvelopesTable::new(data, !self.seq); printer.out(table)?; Ok(()) diff --git a/src/imap/envelope/command/search.rs b/src/imap/envelope/command/search.rs index c8f0b650..cb7368da 100644 --- a/src/imap/envelope/command/search.rs +++ b/src/imap/envelope/command/search.rs @@ -51,9 +51,9 @@ pub struct SearchEnvelopesCommand { #[arg(name = "query", value_name = "QUERY", default_value = "all")] pub query: String, - /// Use UID SEARCH instead of SEARCH. + /// Use sequence numbers instead of UIDs. #[arg(long)] - pub uid: bool, + pub seq: bool, } impl SearchEnvelopesCommand { @@ -79,7 +79,7 @@ impl SearchEnvelopesCommand { // SEARCH let mut arg = None; - let mut coroutine = ImapSearch::new(context, criteria, self.uid); + let mut coroutine = ImapSearch::new(context, criteria, !self.seq); let ids = loop { match coroutine.resume(arg.take()) { @@ -89,7 +89,7 @@ impl SearchEnvelopesCommand { } }; - let table = SearchResultsTable::new(ids, self.uid); + let table = SearchResultsTable::new(ids, !self.seq); printer.out(table)?; Ok(()) diff --git a/src/imap/envelope/command/sort.rs b/src/imap/envelope/command/sort.rs index 56f9dbf9..54da2186 100644 --- a/src/imap/envelope/command/sort.rs +++ b/src/imap/envelope/command/sort.rs @@ -52,9 +52,9 @@ pub struct SortEnvelopesCommand { #[arg(name = "query", value_name = "QUERY", default_value = "all")] pub query: String, - /// Use UID SORT instead of SORT. + /// Use sequence numbers instead of UIDs. #[arg(long)] - pub uid: bool, + pub seq: bool, } impl SortEnvelopesCommand { @@ -87,7 +87,7 @@ impl SortEnvelopesCommand { // SORT let mut arg = None; - let mut coroutine = ImapSort::new(context, sort_criteria, search_criteria, self.uid); + let mut coroutine = ImapSort::new(context, sort_criteria, search_criteria, !self.seq); let ids = loop { match coroutine.resume(arg.take()) { @@ -97,7 +97,7 @@ impl SortEnvelopesCommand { } }; - let table = SortResultsTable::new(ids, self.uid); + let table = SortResultsTable::new(ids, !self.seq); printer.out(table)?; Ok(()) diff --git a/src/imap/envelope/command/thread.rs b/src/imap/envelope/command/thread.rs index 29e53da9..70f37bd0 100644 --- a/src/imap/envelope/command/thread.rs +++ b/src/imap/envelope/command/thread.rs @@ -44,9 +44,9 @@ pub struct ThreadEnvelopesCommand { #[arg(name = "query", value_name = "QUERY", default_value = "all")] pub query: String, - /// Use UID THREAD instead of THREAD. + /// Use sequence numbers instead of UIDs. #[arg(long)] - pub uid: bool, + pub seq: bool, } impl ThreadEnvelopesCommand { @@ -75,7 +75,7 @@ impl ThreadEnvelopesCommand { // THREAD let mut arg = None; - let mut coroutine = ImapThread::new(context, algorithm, search_criteria, self.uid); + let mut coroutine = ImapThread::new(context, algorithm, search_criteria, !self.seq); let (context, threads) = loop { match coroutine.resume(arg.take()) { @@ -90,12 +90,12 @@ impl ThreadEnvelopesCommand { // Fetch subjects for all messages in threads let subjects = if !all_ids.is_empty() { - fetch_subjects(&mut stream, context, &all_ids, self.uid)? + fetch_subjects(&mut stream, context, &all_ids, !self.seq)? } else { HashMap::new() }; - let table = ThreadResultsTable::new(threads, subjects, self.uid); + let table = ThreadResultsTable::new(threads, subjects, !self.seq); printer.out(table)?; Ok(()) diff --git a/src/imap/flag/command/add.rs b/src/imap/flag/command/add.rs index 5980c5b1..f2486765 100644 --- a/src/imap/flag/command/add.rs +++ b/src/imap/flag/command/add.rs @@ -29,9 +29,9 @@ pub struct AddFlagsCommand { #[arg(short, long, required = true, num_args = 1..)] pub flags: Vec, - /// Use UID STORE instead of STORE. + /// Use sequence numbers instead of UIDs. #[arg(long)] - pub uid: bool, + pub seq: bool, } impl AddFlagsCommand { @@ -65,7 +65,7 @@ impl AddFlagsCommand { // Store flags let mut arg = None; let mut coroutine = - ImapStoreSilent::new(context, sequence_set, StoreType::Add, flags, self.uid); + ImapStoreSilent::new(context, sequence_set, StoreType::Add, flags, !self.seq); loop { match coroutine.resume(arg.take()) { diff --git a/src/imap/flag/command/remove.rs b/src/imap/flag/command/remove.rs index 7bf4c834..e5d99b78 100644 --- a/src/imap/flag/command/remove.rs +++ b/src/imap/flag/command/remove.rs @@ -29,9 +29,9 @@ pub struct RemoveFlagsCommand { #[arg(short, long, required = true, num_args = 1..)] pub flags: Vec, - /// Use UID STORE instead of STORE. + /// Use sequence numbers instead of UIDs. #[arg(long)] - pub uid: bool, + pub seq: bool, } impl RemoveFlagsCommand { @@ -65,7 +65,7 @@ impl RemoveFlagsCommand { // Store flags let mut arg = None; let mut coroutine = - ImapStoreSilent::new(context, sequence_set, StoreType::Remove, flags, self.uid); + ImapStoreSilent::new(context, sequence_set, StoreType::Remove, flags, !self.seq); loop { match coroutine.resume(arg.take()) { diff --git a/src/imap/flag/command/set.rs b/src/imap/flag/command/set.rs index d4a56d1e..dcac5b3d 100644 --- a/src/imap/flag/command/set.rs +++ b/src/imap/flag/command/set.rs @@ -29,9 +29,9 @@ pub struct SetFlagsCommand { #[arg(short, long, required = true, num_args = 1..)] pub flags: Vec, - /// Use UID STORE instead of STORE. + /// Use sequence numbers instead of UIDs. #[arg(long)] - pub uid: bool, + pub seq: bool, } impl SetFlagsCommand { @@ -65,7 +65,7 @@ impl SetFlagsCommand { // Store flags let mut arg = None; let mut coroutine = - ImapStoreSilent::new(context, sequence_set, StoreType::Replace, flags, self.uid); + ImapStoreSilent::new(context, sequence_set, StoreType::Replace, flags, !self.seq); loop { match coroutine.resume(arg.take()) {