[network/ruqola] src/widgets/room/delegate: Show read receipts only for own messages in direct conversations
Till Adam <[email protected]>
| Newsgroups | gmane.comp.kde.cvs |
|---|---|
| Message-ID | <[email protected]> |
Git commit 6ac64a8e6dc6d980ea4a20793200e0567fd4ff5f by Till Adam.
Committed on 27/07/2026 at 22:09.
Pushed by tilladam into branch 'master'.
Show read receipts only for own messages in direct conversations
The single/double-check read-receipt glyph was painted next to every message's timestamp, driven solely by `Message::unread()`. That flag is only meaningful when the server-side read-receipt feature is enabled, and even then "read by everyone" only resolves quickly in a direct conversation — in a room it rarely flips, so a permanent single check on every message was just noise, and where the feature is off the absent flag rendered as a bogus double check ("read by everyone") on everything.
Only paint the glyph for one's own messages in a direct conversation, and only when `Message_Read_Receipt_Enabled` is set — i.e. where the indicator actually carries information.
This is a deliberate divergence from the upstream Rocket.Chat clients (which show it on all messages in all rooms), agreed with the maintainer.
Known limitation (pre-existing, not addressed here): the `unread` flag is only set when a message is parsed on load, so the single→double transition is not live; being investigated separately.
M +7 -1 src/widgets/room/delegate/messagelistdelegate.cpp
https://invent.kde.org/network/ruqola/-/commit/6ac64a8e6dc6d980ea4a20793200e0567fd4ff5f
diff --git a/src/widgets/room/delegate/messagelistdelegate.cpp b/src/widgets/room/delegate/messagelistdelegate.cpp
index 6085e048b7..e7eec491cf 100644
--- a/src/widgets/room/delegate/messagelistdelegate.cpp
+++ b/src/widgets/room/delegate/messagelistdelegate.cpp
@@ -623,9 +623,15 @@ void MessageListDelegate::paint(QPainter *painter, const QStyleOptionViewItem &o
mTranslatedIcon.paint(painter, layout.translatedIconRect);
}
+ // A read receipt only carries meaning for one's own messages in a direct conversation:
+ // in rooms "read by everyone" rarely resolves so the per-message flag is just noise, and
+ // the flag only tracks read state at all when the server-side feature is enabled.
+ const Room *room = mRocketChatAccount->room(message->roomId());
+ const bool ownMessageInDirectRoom = room && room->channelType() == Room::RoomType::Direct && message->userId() == mRocketChatAccount->userId();
// The read receipt follows the timestamp: on the author line for a new sender,
// and suppressed for grouped rows (null rect) where the timestamp is gutter-only.
- if (showTimestamp && layout.readReceiptIconRect.isValid()) {
+ if (showTimestamp && layout.readReceiptIconRect.isValid() && ownMessageInDirectRoom
+ && mRocketChatAccount->ruqolaServerConfig()->messageReadReceiptEnabled()) {
if (message->unread()) {
mSingleCheckIcon.paint(painter, layout.readReceiptIconRect);
} else {