diff --git a/src/models/reactionmodel.cpp b/src/models/reactionmodel.cpp index b56142497..6a4260ede 100644 --- a/src/models/reactionmodel.cpp +++ b/src/models/reactionmodel.cpp @@ -69,7 +69,7 @@ QVariant ReactionModel::data(const QModelIndex &index, int role) const text += i18nc("Separate the usernames of users", " and "); } } - text += reaction.authors.at(i).displayName(); + text += m_room->member(reaction.authors.at(i)).displayName(); } if (reaction.authors.count() > 3) { @@ -87,7 +87,7 @@ QVariant ReactionModel::data(const QModelIndex &index, int role) const if (role == HasLocalMember) { for (auto author : reaction.authors) { - if (author.id() == m_room->localMember().id()) { + if (author == m_room->localMember().id()) { return true; } } @@ -116,13 +116,13 @@ void ReactionModel::updateReactions() return; }; - QMap> reactions = {}; + QMap reactions = {}; for (const auto &a : annotations) { if (a->isRedacted()) { // Just in case? continue; } if (const auto &e = eventCast(a)) { - reactions[e->key()].append(m_room->member(e->senderId())); + reactions[e->key()].append(e->senderId()); if (e->contentJson()[QStringLiteral("shortcode")].toString().length()) { m_shortcodes[e->key()] = e->contentJson()[QStringLiteral("shortcode")].toString().toHtmlEscaped(); } @@ -135,7 +135,7 @@ void ReactionModel::updateReactions() } auto i = reactions.constBegin(); while (i != reactions.constEnd()) { - QList members; + QStringList members; for (const auto &member : i.value()) { members.append(member); } diff --git a/src/models/reactionmodel.h b/src/models/reactionmodel.h index 0825dd025..df9cb57e1 100644 --- a/src/models/reactionmodel.h +++ b/src/models/reactionmodel.h @@ -25,7 +25,7 @@ public: */ struct Reaction { QString reaction; /**< The reaction emoji. */ - QList authors; /**< The list of authors who sent the given reaction. */ + QStringList authors; /**< The list of authors who sent the given reaction. */ }; /**