From 2f47f1eebd5844528d76a1684a90ca7617abc4be Mon Sep 17 00:00:00 2001 From: Manos Pitsidianakis Date: Fri, 8 Jan 2021 15:22:41 +0200 Subject: [PATCH] melib/jmap: fix mailbox children relationships being ignored --- melib/src/backends/jmap/protocol.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/melib/src/backends/jmap/protocol.rs b/melib/src/backends/jmap/protocol.rs index f15bc2bf4..5b2b1295d 100644 --- a/melib/src/backends/jmap/protocol.rs +++ b/melib/src/backends/jmap/protocol.rs @@ -109,7 +109,7 @@ pub async fn get_mailboxes(conn: &JmapConnection) -> Result = list .into_iter() .map(|r| { let MailboxObject { @@ -157,7 +157,13 @@ pub async fn get_mailboxes(conn: &JmapConnection) -> Result>() { + if let Some(parent_hash) = ret[&key].parent_hash.clone() { + ret.entry(parent_hash).and_modify(|e| e.children.push(key)); + } + } + Ok(ret) } pub async fn get_message_list(