From a1a37497006a5440ea5ab529c2fe413e133d4c4e Mon Sep 17 00:00:00 2001 From: jenli669 Date: Sat, 15 Jun 2019 00:34:02 +0200 Subject: [PATCH] fix(group): fix logic oversight and code style --- src/model/group.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/model/group.cpp b/src/model/group.cpp index fe210e47f..d33ab5ded 100644 --- a/src/model/group.cpp +++ b/src/model/group.cpp @@ -95,9 +95,11 @@ void Group::regeneratePeerList() const int nPeers = peers.size(); for (int i = 0; i < nPeers; ++i) { const auto pk = core->getGroupPeerPk(toxGroupNum, i); - if (pk == core->getSelfPublicKey()) + if (pk == core->getSelfPublicKey()) { peerDisplayNames[pk] = core->getUsername(); - peerDisplayNames[pk] = FriendList::decideNickname(pk, peers[i]); + } else { + peerDisplayNames[pk] = FriendList::decideNickname(pk, peers[i]); + } } for (const auto& pk : oldPeerNames.keys()) { if (!peerDisplayNames.contains(pk)) {