aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey Rusakov <Kitsune-Ral@users.sf.net>2021-07-25 09:04:35 +0200
committerAlexey Rusakov <Kitsune-Ral@users.sf.net>2021-07-25 09:04:35 +0200
commit240ab55c1ec700d5d9c5456fe120c4af17767778 (patch)
treef451f50fdbaf2c144d22b5b51715e0f9181d1ee2
parentef4957eb544ccb3824c4e5ac00b724192b76f1f2 (diff)
downloadlibquotient-240ab55c1ec700d5d9c5456fe120c4af17767778.tar.gz
libquotient-240ab55c1ec700d5d9c5456fe120c4af17767778.zip
Room: update cache state if needed after loading history
For now this is to update saved unread counts.
-rw-r--r--lib/room.cpp4
1 files changed, 3 insertions, 1 deletions
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).