From 0f51c34b24bce4fbc786e05788da150592d85d7a Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Sun, 2 Feb 2025 15:58:19 -0500 Subject: [PATCH] Add dedicated invitation subtitle text to rooms Instead of displaying the message event - or usually nothing at all - show a label like "user has invited you". --- src/models/roomtreemodel.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/models/roomtreemodel.cpp b/src/models/roomtreemodel.cpp index e7350aa2e..c605de7a9 100644 --- a/src/models/roomtreemodel.cpp +++ b/src/models/roomtreemodel.cpp @@ -348,6 +348,12 @@ QVariant RoomTreeModel::data(const QModelIndex &index, int role) const return QVariant::fromValue(room); } if (role == SubtitleTextRole) { + if (room->isInvite()) { + if (room->isDirectChat()) { + return i18nc("@info:label", "Invited you to chat"); + } + return i18nc("@info:label", "%1 invited you", room->member(room->invitingUserId()).displayName()); + } if (room->lastEvent() == nullptr || room->lastEventIsSpoiler()) { return QString(); }