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

Merge pull request #5919

Mick Sayson (1):
      fix(groups): Fix invalid group list on group member join
This commit is contained in:
sudden6 2019-11-10 13:03:30 +01:00
commit 7349b44154
No known key found for this signature in database
GPG Key ID: 279509B499E032B9

View File

@ -1502,7 +1502,9 @@ QStringList Core::getGroupPeerNames(int groupId) const
for (uint32_t i = 0; i < nPeers; ++i) { for (uint32_t i = 0; i < nPeers; ++i) {
Tox_Err_Conference_Peer_Query error; Tox_Err_Conference_Peer_Query error;
size_t length = tox_conference_peer_get_name_size(tox.get(), groupId, i, &error); size_t length = tox_conference_peer_get_name_size(tox.get(), groupId, i, &error);
if (!PARSE_ERR(error) || !length) { if (!PARSE_ERR(error) || !length) {
names.append(QString());
continue; continue;
} }
@ -1510,9 +1512,13 @@ QStringList Core::getGroupPeerNames(int groupId) const
tox_conference_peer_get_name(tox.get(), groupId, i, nameBuf.data(), &error); tox_conference_peer_get_name(tox.get(), groupId, i, nameBuf.data(), &error);
if (PARSE_ERR(error)) { if (PARSE_ERR(error)) {
names.append(ToxString(nameBuf.data(), length).getQString()); names.append(ToxString(nameBuf.data(), length).getQString());
} else {
names.append(QString());
} }
} }
assert(names.size() == nPeers);
return names; return names;
} }