From f1fd6f43f9a88729785ddf729e41a5be7d985fbc Mon Sep 17 00:00:00 2001 From: Clemens-Toegel <42837076+Clemens-Toegel@users.noreply.github.com> Date: Fri, 20 Oct 2023 09:50:01 +0200 Subject: [PATCH] chore: remove archived room on forget (#2) Co-authored-by: Clemens Toegel --- lib/src/room.dart | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/src/room.dart b/lib/src/room.dart index 861f41d2..37ed4f5e 100644 --- a/lib/src/room.dart +++ b/lib/src/room.dart @@ -1187,6 +1187,12 @@ class Room { Future forget() async { await client.database?.forgetRoom(id); await client.forgetRoom(id); + // Update archived rooms, otherwise an archived room may still be in the + // list after a forget room call + final roomIndex = client.archivedRooms.indexWhere((r) => r.room.id == id); + if(roomIndex != -1){ + client.archivedRooms.removeAt(roomIndex); + } return; }