Refresh Room.unverified_devices when members leave

This commit is contained in:
miruka 2020-07-11 17:23:36 -04:00
parent 2644e6d8b0
commit b4f706d2e8

View File

@ -1726,9 +1726,13 @@ class MatrixClient(nio.AsyncClient):
async def remove_member(self, room: nio.MatrixRoom, user_id: str) -> None: async def remove_member(self, room: nio.MatrixRoom, user_id: str) -> None:
"""Remove a room member from our models.""" """Remove a room member from our models."""
self.models[self.user_id, room.room_id, "members"].pop(user_id, None) 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) 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: 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. """Fetch from network an event's sender, target and remover's profile.