diff options
author | Manos Pitsidianakis <el13635@mail.ntua.gr> | 2022-11-28 16:56:37 +0200 |
---|---|---|
committer | Manos Pitsidianakis <el13635@mail.ntua.gr> | 2022-11-28 16:56:37 +0200 |
commit | 7924aa8bfe8f0fbcd557bb8bb3a9d3ebeab2220a (patch) | |
tree | a98848c3b01c8aff6272db69ccc5c15d5ae61840 | |
parent | 7af893597f5a3f3261bfff47dae0723bf1b17e53 (diff) | |
download | meli-7924aa8bfe8f0fbcd557bb8bb3a9d3ebeab2220a.zip |
melib/jmap: fix compilation
-rw-r--r-- | melib/src/backends/jmap.rs | 69 | ||||
-rw-r--r-- | melib/src/backends/jmap/protocol.rs | 7 |
2 files changed, 35 insertions, 41 deletions
diff --git a/melib/src/backends/jmap.rs b/melib/src/backends/jmap.rs index 4b03e404..238e2651 100644 --- a/melib/src/backends/jmap.rs +++ b/melib/src/backends/jmap.rs @@ -93,9 +93,9 @@ use mailbox::*; #[derive(Debug, Default)] pub struct EnvelopeCache { bytes: Option<String>, - headers: Option<String>, - body: Option<String>, - flags: Option<Flag>, + // headers: Option<String>, + // body: Option<String>, + // flags: Option<Flag>, } #[derive(Debug, Clone)] @@ -153,34 +153,6 @@ impl JmapServerConf { } } -macro_rules! get_conf_val { - ($s:ident[$var:literal]) => { - $s.extra.get($var).ok_or_else(|| { - MeliError::new(format!( - "Configuration error ({}): JMAP connection requires the field `{}` set", - $s.name.as_str(), - $var - )) - }) - }; - ($s:ident[$var:literal], $default:expr) => { - $s.extra - .get($var) - .map(|v| { - <_>::from_str(v).map_err(|e| { - MeliError::new(format!( - "Configuration error ({}): Invalid value for field `{}`: {}\n{}", - $s.name.as_str(), - $var, - v, - e - )) - }) - }) - .unwrap_or_else(|| Ok($default)) - }; -} - #[derive(Debug)] pub struct Store { pub account_name: Arc<String>, @@ -587,7 +559,7 @@ impl MailBackend for JmapType { _new_path: String, ) -> ResultFuture<Mailbox> { Err(MeliError::new( - "Renaming mailbox is currently unimplemented for jmap backend.", + "Renaming mailbox is currently unimplemented for the JMAP backend.", )) } @@ -596,7 +568,36 @@ impl MailBackend for JmapType { _path: String, ) -> ResultFuture<(MailboxHash, HashMap<MailboxHash, Mailbox>)> { Err(MeliError::new( - "Creating mailbox is currently unimplemented for jmap backend.", + "Creating mailbox is currently unimplemented for the JMAP backend.", + )) + } + + fn delete_mailbox( + &mut self, + _mailbox_hash: MailboxHash, + ) -> ResultFuture<HashMap<MailboxHash, Mailbox>> { + Err(MeliError::new( + "Deleting a mailbox is currently unimplemented for the JMAP backend.", + )) + } + + fn set_mailbox_subscription( + &mut self, + _mailbox_hash: MailboxHash, + _val: bool, + ) -> ResultFuture<()> { + Err(MeliError::new( + "Setting mailbox subscription is currently unimplemented for the JMAP backend.", + )) + } + + fn set_mailbox_permissions( + &mut self, + _mailbox_hash: MailboxHash, + _val: MailboxPermissions, + ) -> ResultFuture<()> { + Err(MeliError::new( + "Setting mailbox permissions is currently unimplemented for the JMAP backend.", )) } @@ -865,7 +866,7 @@ impl MailBackend for JmapType { _mailbox_hash: MailboxHash, ) -> ResultFuture<()> { Err(MeliError::new( - "Deleting messages is currently unimplemented for jmap backend.", + "Deleting messages is currently unimplemented for the JMAP backend.", )) } } diff --git a/melib/src/backends/jmap/protocol.rs b/melib/src/backends/jmap/protocol.rs index 7eb7e640..0e4db8c1 100644 --- a/melib/src/backends/jmap/protocol.rs +++ b/melib/src/backends/jmap/protocol.rs @@ -77,13 +77,6 @@ impl Request { } } -#[derive(Deserialize, Debug)] -#[serde(rename_all = "camelCase")] -pub struct JsonResponse<'a> { - #[serde(borrow)] - method_responses: Vec<MethodResponse<'a>>, -} - pub async fn get_mailboxes(conn: &JmapConnection) -> Result<HashMap<MailboxHash, JmapMailbox>> { let seq = get_request_no!(conn.request_no); let api_url = conn.session.lock().unwrap().api_url.clone(); |