melib/jmap: fix mailbox children relationships being ignored
parent
622ded8021
commit
2f47f1eebd
|
@ -109,7 +109,7 @@ pub async fn get_mailboxes(conn: &JmapConnection) -> Result<HashMap<MailboxHash,
|
||||||
list, account_id, ..
|
list, account_id, ..
|
||||||
} = m;
|
} = m;
|
||||||
*conn.store.account_id.lock().unwrap() = account_id;
|
*conn.store.account_id.lock().unwrap() = account_id;
|
||||||
Ok(list
|
let mut ret: HashMap<MailboxHash, JmapMailbox> = list
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.map(|r| {
|
.map(|r| {
|
||||||
let MailboxObject {
|
let MailboxObject {
|
||||||
|
@ -157,7 +157,13 @@ pub async fn get_mailboxes(conn: &JmapConnection) -> Result<HashMap<MailboxHash,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
.collect())
|
.collect();
|
||||||
|
for key in ret.keys().cloned().collect::<SmallVec<[MailboxHash; 24]>>() {
|
||||||
|
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(
|
pub async fn get_message_list(
|
||||||
|
|
Loading…
Reference in New Issue