summary refs log tree commit diff
path: root/src/Cache.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Cache.cpp')
-rw-r--r--src/Cache.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/Cache.cpp b/src/Cache.cpp

index fb2ded7d..bdca76f2 100644 --- a/src/Cache.cpp +++ b/src/Cache.cpp
@@ -829,6 +829,7 @@ Cache::filterReadEvents(const QString &room_id, void Cache::updateReadReceipt(lmdb::txn &txn, const std::string &room_id, const Receipts &receipts) { + auto user_id = this->localUserId_.toStdString(); for (const auto &receipt : receipts) { const auto event_id = receipt.first; auto event_receipts = receipt.second; @@ -857,8 +858,13 @@ Cache::updateReadReceipt(lmdb::txn &txn, const std::string &room_id, const Recei } // Append the new ones. - for (const auto &event_receipt : event_receipts) - saved_receipts.emplace(event_receipt.first, event_receipt.second); + for (const auto &[read_by, timestamp] : event_receipts) { + if (read_by == user_id) { + emit removeNotification(QString::fromStdString(room_id), + QString::fromStdString(event_id)); + } + saved_receipts.emplace(read_by, timestamp); + } // Save back the merged (or only the new) receipts. nlohmann::json json_updated_value = saved_receipts;