From 62b962cb44b410c2b7e1317488cf78a8c7cbcd81 Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Sun, 23 Feb 2020 21:51:59 +0100 Subject: Improve read status handling in room list Only consider the room as unread, if there is a message in the room and only consider message and sticker events as messages. fixes #65 --- src/Cache.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/Cache.cpp') diff --git a/src/Cache.cpp b/src/Cache.cpp index caa3f1ec..1361606f 100644 --- a/src/Cache.cpp +++ b/src/Cache.cpp @@ -918,6 +918,9 @@ Cache::calculateRoomReadStatus(const std::string &room_id) const auto last_event_id = getLastMessageInfo(txn, room_id).event_id; const auto localUser = utils::localUser().toStdString(); + if (last_event_id.isEmpty()) + return false; + txn.commit(); // Retrieve all read receipts for that event. -- cgit 1.4.1