From 91939509709076bbf3e19961954d74321d4571fa Mon Sep 17 00:00:00 2001 From: Krille Fear Date: Mon, 25 Oct 2021 10:55:54 +0200 Subject: [PATCH] fix: Auto update room states Room states are ignored if the event with the same event ID is already known in the database. But because of the event is stored in the database and after this setState in the Room class is called, an event is always "known" and therefore auto updating was broken. --- lib/src/client.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/client.dart b/lib/src/client.dart index c00c6fd0..4dbbb3dd 100644 --- a/lib/src/client.dart +++ b/lib/src/client.dart @@ -1430,10 +1430,10 @@ class Client extends MatrixApi { room.setState(user); } } + _updateRoomsByEventUpdate(update); if (type != EventUpdateType.ephemeral && database != null) { await database.storeEventUpdate(update); } - _updateRoomsByEventUpdate(update); if (encryptionEnabled) { await encryption.handleEventUpdate(update); }