1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

groupchats: friend's aliases (updates on rejoin)

This commit is contained in:
apprb 2014-11-24 01:22:41 +09:00
parent 41d799b251
commit cf54aa6577
No known key found for this signature in database
GPG Key ID: B001911B5B22FB9B

View File

@ -66,10 +66,18 @@ void Group::removePeer(int peerId)
void Group::updatePeer(int peerId, QString name)
{
ToxID id = Core::getInstance()->getGroupPeerToxID(groupId, peerId);
QString toxid = id.publicKey;
peers[peerId] = name;
QString toxid = Core::getInstance()->getGroupPeerToxID(groupId, peerId).publicKey;
toxids[toxid] = name;
Friend *f = FriendList::findFriend(id);
if (f)
{
peers[peerId] = f->getDisplayedName();
toxids[toxid] = f->getDisplayedName();
}
widget->onUserListChanged();
chatForm->onUserListChanged();
}
@ -91,9 +99,17 @@ void Group::regeneratePeerList()
nPeers = peerLst.size();
for (int i = 0; i < peerLst.size(); i++)
{
ToxID id = Core::getInstance()->getGroupPeerToxID(groupId, i);
QString toxid = id.publicKey;
peers[i] = peerLst.at(i);
QString toxid = Core::getInstance()->getGroupPeerToxID(groupId, i).publicKey;
toxids[toxid] = peerLst.at(i);
Friend *f = FriendList::findFriend(id);
if (f)
{
peers[i] = f->getDisplayedName();
toxids[toxid] = f->getDisplayedName();
}
}
widget->onUserListChanged();