diff options
author | Nicolas Werner <nicolas.werner@hotmail.de> | 2020-05-04 00:56:30 +0200 |
---|---|---|
committer | Nicolas Werner <nicolas.werner@hotmail.de> | 2020-05-04 00:57:40 +0200 |
commit | a8b22e49c337884c8e8a68c1c73084854fcd44d1 (patch) | |
tree | 6f156b3085c4b7e7c592a790ba49231e93dbeba2 /src | |
parent | Speed up initial load a bit (diff) | |
download | nheko-a8b22e49c337884c8e8a68c1c73084854fcd44d1.tar.xz |
Fix self counting as read message
Diffstat (limited to 'src')
-rw-r--r-- | src/Cache.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/Cache.cpp b/src/Cache.cpp index 1ae7a846..aca01c1a 100644 --- a/src/Cache.cpp +++ b/src/Cache.cpp @@ -887,6 +887,7 @@ void Cache::saveState(const mtx::responses::Sync &res) { using namespace mtx::events; + auto user_id = this->localUserId_.toStdString(); auto txn = lmdb::txn::begin(env_); @@ -960,8 +961,10 @@ Cache::saveState(const mtx::responses::Sync &res) if (!room.second.ephemeral.receipts.empty()) { std::vector<QString> receipts; for (const auto &receipt : room.second.ephemeral.receipts) - receipts.push_back(QString::fromStdString(receipt.first)); - emit newReadReceipts(QString::fromStdString(room.first), receipts); + if (receipt.first != user_id) + receipts.push_back(QString::fromStdString(receipt.first)); + if (!receipts.empty()) + emit newReadReceipts(QString::fromStdString(room.first), receipts); } readStatus.emplace(QString::fromStdString(room.first), calculateRoomReadStatus(room.first)); |