Skip to content

Commit 5e1bae0

Browse files
committed
feat(ffi): Add RoomPreview::forget action in the FFI layer
1 parent 77a67de commit 5e1bae0

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

bindings/matrix-sdk-ffi/src/room_preview.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,14 @@ impl RoomPreview {
6565
invite_details.inviter.and_then(|m| m.try_into().ok())
6666
}
6767

68+
/// Forget the room if we had access to it, and it was left or banned.
69+
pub async fn forget(&self) -> Result<(), ClientError> {
70+
let room =
71+
self.client.get_room(&self.inner.room_id).context("missing room for a room preview")?;
72+
room.forget().await?;
73+
Ok(())
74+
}
75+
6876
/// Get the membership details for the current user.
6977
pub async fn own_membership_details(&self) -> Option<RoomMembershipDetails> {
7078
let room = self.client.get_room(&self.inner.room_id)?;

0 commit comments

Comments
 (0)