From 87a53fad96eb372630914748a864a45f55f13d29 Mon Sep 17 00:00:00 2001 From: Anthony Bilinski Date: Tue, 14 May 2019 16:06:55 -0700 Subject: [PATCH] fix(ui): don't duplicate group peer name in tooltip --- src/widget/form/groupchatform.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/widget/form/groupchatform.cpp b/src/widget/form/groupchatform.cpp index 308766e34..8f3b8ca0f 100644 --- a/src/widget/form/groupchatform.cpp +++ b/src/widget/form/groupchatform.cpp @@ -241,12 +241,14 @@ void GroupChatForm::updateUserNames() * and then sort them by their text and add them to the layout in that order */ const auto selfPk = Core::getInstance()->getSelfPublicKey(); for (const auto& peerPk : peers.keys()) { - const QString fullName = FriendList::decideNickname(peerPk, peers.value(peerPk)); - const QString editedName = editName(fullName).append(QLatin1String(", ")); - QLabel* const label = new QLabel(editedName); - if (editedName != fullName) { - label->setToolTip(fullName + " (" + peerPk.toString() + ")"); - } + const QString peerName = peers.value(peerPk); + const QString editedName = editName(peerName); + QLabel* const label = new QLabel(editedName + QLatin1String(", ")); + if (editedName != peerName) { + label->setToolTip(peerName + " (" + peerPk.toString() + ")"); + } else if (peerName != peerPk.toString()) { + label->setToolTip(peerPk.toString()); + } // else their name is just their Pk, no tooltip needed label->setTextFormat(Qt::PlainText); label->setContextMenuPolicy(Qt::CustomContextMenu);