diff options
author | Alexey Rusakov <Kitsune-Ral@users.sf.net> | 2021-08-01 17:19:23 +0200 |
---|---|---|
committer | Alexey Rusakov <Kitsune-Ral@users.sf.net> | 2021-08-09 22:27:09 +0200 |
commit | 8093ea85347588431c0ddbf6e178a4db5f51b909 (patch) | |
tree | 70984115690321733b7296e2f6e107ae05d52217 /lib/room.cpp | |
parent | 6d558fa9c12b52fe3cc47cc143d0a758c4ea929a (diff) | |
download | libquotient-8093ea85347588431c0ddbf6e178a4db5f51b909.tar.gz libquotient-8093ea85347588431c0ddbf6e178a4db5f51b909.zip |
Enhanced logging for read receipts
Diffstat (limited to 'lib/room.cpp')
-rw-r--r-- | lib/room.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/room.cpp b/lib/room.cpp index 649b1ed2..e7d4e137 100644 --- a/lib/room.cpp +++ b/lib/room.cpp @@ -617,7 +617,8 @@ void Room::Private::setLastReadReceipt(User* u, rev_iter_t newMarker, return; // For Release builds } if (q->memberJoinState(u) != JoinState::Join) { - qCWarning(MAIN) << "Won't record read receipt for non-member" << u->id(); + qCWarning(EPHEMERAL) + << "Won't record read receipt for non-member" << u->id(); return; } @@ -626,8 +627,11 @@ void Room::Private::setLastReadReceipt(User* u, rev_iter_t newMarker, newMarker = q->findInTimeline(newReceipt.eventId); if (newMarker != timeline.crend()) { // NB: with reverse iterators, timeline history >= sync edge - if (newMarker >= q->findInTimeline(storedReceipt.eventId)) + if (newMarker >= q->findInTimeline(storedReceipt.eventId)) { + qCDebug(EPHEMERAL) << "The new read receipt for" << u->id() + << "is at or behind the old one, skipping"; return; + } // Try to auto-promote the read marker over the user's own messages // (switch to direct iterators for that). @@ -651,6 +655,8 @@ void Room::Private::setLastReadReceipt(User* u, rev_iter_t newMarker, eventIdReadUsers.remove(storedReceipt.eventId); eventIdReadUsers[newReceipt.eventId].insert(u); swap(storedReceipt, newReceipt); // Now newReceipt actually stores the old receipt + qCDebug(EPHEMERAL) << "The new read receipt for" << u->id() << "is at" + << storedReceipt.eventId; emit q->lastReadEventChanged(u); // TODO: remove in 0.8 if (!isLocalUser(u)) |