[client] F22a: forget_contact — drops the group, the name and the mailbox, for Remove person
ci / check (pull_request) Has been cancelled

This commit is contained in:
2026-11-16 02:08:24 +01:00
parent 4f78101735
commit 3ac2075ec6
3 changed files with 78 additions and 0 deletions
+15
View File
@@ -301,6 +301,21 @@ impl<T: Transport> Client<T> {
self.welcome_boxes.retain(|w| w.invite != *invite);
}
/// Forgets a contact: its MLS group is deleted from storage, its name and tokens from the
/// client, and its mailbox is no longer fetched. The other side is not told, and anything it
/// still posts waits on the relay until it expires. Save the snapshot after it. Returns whether
/// there was such a contact.
pub fn forget_contact(&mut self, contact: ContactId) -> Result<bool, ClientError> {
let Some(index) = self.contacts.iter().position(|c| c.id == contact) else {
return Ok(false);
};
let mut c = self.contacts.remove(index);
c.group
.delete(self.provider.storage())
.map_err(|_| ClientError::State)?;
Ok(true)
}
/// Step 2, on the other device, staged: claims the KeyPackage (which uses the link up) and
/// creates our mailbox, then makes the group. The Welcome and our `hello` come back for the
/// app to deliver after saving.