From 4e6850a60c78835442d0983f5df3642cd04349d3 Mon Sep 17 00:00:00 2001 From: Tobias Fella Date: Tue, 30 Apr 2024 17:05:20 +0200 Subject: [PATCH] Adapt to behavior change in libQuotient --- src/eventhandler.cpp | 6 +++++- src/models/reactionmodel.cpp | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/eventhandler.cpp b/src/eventhandler.cpp index c737d68f4..ca42438b1 100644 --- a/src/eventhandler.cpp +++ b/src/eventhandler.cpp @@ -1041,7 +1041,11 @@ QString EventHandler::getReadMarkersString() const QString readMarkersString = i18np("1 user: ", "%1 users: ", userIds.size()); for (const auto &userId : userIds) { auto user = m_room->user(userId); - readMarkersString += user->displayname(m_room) + i18nc("list separator", ", "); + auto displayName = user->displayname(m_room); + if (displayName.isEmpty()) { + displayName = userId; + } + readMarkersString += displayName + i18nc("list separator", ", "); } readMarkersString.chop(2); return readMarkersString; diff --git a/src/models/reactionmodel.cpp b/src/models/reactionmodel.cpp index 157dc3d03..9c9b3f5f7 100644 --- a/src/models/reactionmodel.cpp +++ b/src/models/reactionmodel.cpp @@ -68,7 +68,8 @@ QVariant ReactionModel::data(const QModelIndex &index, int role) const text += i18nc("Separate the usernames of users", " and "); } } - text += reaction.authors.at(i).toMap()[QStringLiteral("displayName")].toString(); + auto displayName = reaction.authors.at(i).toMap()[QStringLiteral("displayName")].toString(); + text += displayName.isEmpty() ? reaction.authors.at(i).toMap()[QStringLiteral("id")].toString() : displayName; } if (reaction.authors.count() > 3) {