summaryrefslogtreecommitdiff
path: root/melib
diff options
context:
space:
mode:
authorGuillaume Ranquet <granquet@baylibre.com>2022-07-19 14:27:38 +0200
committerManos Pitsidianakis <el13635@mail.ntua.gr>2022-08-25 12:52:39 +0300
commit9205f3b8afe28ef3a68959d590ed967946a5d622 (patch)
tree8beabf3f4af50cf0b7f707dec51466b8112856f7 /melib
parent97ff3e787fbfb5ff50e3ba787f067829509f7cd2 (diff)
downloadmeli-9205f3b8afe28ef3a68959d590ed967946a5d622.zip
conf.rs: handle a per account mail order parameter
The new order parameter adds the possibility to specify a sort order on a per account basis. Signed-off-by: Guillaume Ranquet <granquet@baylibre.com>
Diffstat (limited to 'melib')
-rw-r--r--melib/src/conf.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/melib/src/conf.rs b/melib/src/conf.rs
index 6168e60a..32effd8e 100644
--- a/melib/src/conf.rs
+++ b/melib/src/conf.rs
@@ -21,6 +21,7 @@
//! Basic mail account configuration to use with [`backends`](./backends/index.html)
use crate::backends::SpecialUsageMailbox;
+pub use crate::{SortField, SortOrder};
use serde::{Deserialize, Deserializer, Serialize, Serializer};
use std::collections::HashMap;
@@ -33,6 +34,8 @@ pub struct AccountSettings {
pub extra_identities: Vec<String>,
pub read_only: bool,
pub display_name: Option<String>,
+ #[serde(default)]
+ pub order: (SortField, SortOrder),
pub subscribed_mailboxes: Vec<String>,
#[serde(default)]
pub mailboxes: HashMap<String, MailboxConf>,
@@ -64,6 +67,9 @@ impl AccountSettings {
pub fn display_name(&self) -> Option<&String> {
self.display_name.as_ref()
}
+ pub fn order(&self) -> Option<(SortField, SortOrder)> {
+ Some(self.order)
+ }
pub fn subscribed_mailboxes(&self) -> &Vec<String> {
&self.subscribed_mailboxes