From b4f706d2e8f5537aae617c2e80bb95064c3f3e49 Mon Sep 17 00:00:00 2001 From: miruka Date: Sat, 11 Jul 2020 17:23:36 -0400 Subject: [PATCH] Refresh Room.unverified_devices when members leave --- src/backend/matrix_client.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/backend/matrix_client.py b/src/backend/matrix_client.py index 142c1695..7f938bfc 100644 --- a/src/backend/matrix_client.py +++ b/src/backend/matrix_client.py @@ -1726,9 +1726,13 @@ class MatrixClient(nio.AsyncClient): async def remove_member(self, room: nio.MatrixRoom, user_id: str) -> None: """Remove a room member from our models.""" + self.models[self.user_id, room.room_id, "members"].pop(user_id, None) HTML.rooms_user_id_names[room.room_id].pop(user_id, None) + self.models[self.user_id, "rooms"][room.room_id].unverified_devices = \ + self.room_contains_unverified(room.room_id) + async def get_event_profiles(self, room_id: str, event_id: str) -> None: """Fetch from network an event's sender, target and remover's profile.