Add clear messages shortcut

This commit is contained in:
miruka
2019-09-08 11:49:47 -04:00
parent db0de237e6
commit e93c251624
5 changed files with 22 additions and 4 deletions

View File

@@ -385,8 +385,9 @@ class MatrixClient(nio.AsyncClient):
async def clear_events(self, room_id: str) -> None:
self.cleared_events_rooms.add(room_id)
model = self.models[Event, self.user_id, room_id]
model.clear()
model.sync_now()
if model:
model.clear()
model.sync_now()
# Functions to register data into models