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".
This commit is contained in:
Joshua Goins
2025-02-02 15:58:19 -05:00
parent f6a427e865
commit 0f51c34b24

View File

@@ -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();
}