From 240ab55c1ec700d5d9c5456fe120c4af17767778 Mon Sep 17 00:00:00 2001 From: Alexey Rusakov Date: Sun, 25 Jul 2021 09:04:35 +0200 Subject: Room: update cache state if needed after loading history For now this is to update saved unread counts. --- lib/room.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/room.cpp b/lib/room.cpp index 1f239322..b461b0a1 100644 --- a/lib/room.cpp +++ b/lib/room.cpp @@ -2457,7 +2457,9 @@ void Room::Private::addHistoricalMessageEvents(RoomEvents&& events) emit q->updatedEvent(relation.eventId); } } - updateUnreadCount(from, historyEdge()); + if (updateUnreadCount(from, historyEdge()) != NoChange) + connection->saveRoomState(q); + // When there are no unread messages and the read marker is within the // known timeline, unreadMessages == -1 // (see https://github.com/quotient-im/libQuotient/wiki/unread_count). -- cgit v1.2.3