mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
parent
e8d48e8788
commit
33d42c9766
|
@ -1038,16 +1038,26 @@ void Core::loadGroups()
|
||||||
QString name;
|
QString name;
|
||||||
const auto groupNumber = groupNumbers[i];
|
const auto groupNumber = groupNumbers[i];
|
||||||
size_t titleSize = tox_conference_get_title_size(tox.get(), groupNumber, &error);
|
size_t titleSize = tox_conference_get_title_size(tox.get(), groupNumber, &error);
|
||||||
|
const GroupId persistentId = getGroupPersistentId(groupNumber);
|
||||||
|
const QString defaultName = tr("Groupchat %1").arg(persistentId.toString().left(8));
|
||||||
if (LogConferenceTitleError(error)) {
|
if (LogConferenceTitleError(error)) {
|
||||||
name = tr("Groupchat %1").arg(getGroupPersistentId(groupNumber).toString().left(8));
|
name = defaultName;
|
||||||
} else {
|
} else {
|
||||||
QByteArray nameByteArray = QByteArray(static_cast<int>(titleSize), Qt::Uninitialized);
|
QByteArray nameByteArray = QByteArray(static_cast<int>(titleSize), Qt::Uninitialized);
|
||||||
tox_conference_get_title(tox.get(), groupNumber,
|
tox_conference_get_title(tox.get(), groupNumber,
|
||||||
reinterpret_cast<uint8_t*>(nameByteArray.data()), &error);
|
reinterpret_cast<uint8_t*>(nameByteArray.data()), &error);
|
||||||
name = ToxString(nameByteArray).getQString();
|
if (LogConferenceTitleError(error)) {
|
||||||
|
name = defaultName;
|
||||||
|
} else {
|
||||||
|
name = ToxString(nameByteArray).getQString();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
if (getGroupAvEnabled(groupNumber)) {
|
||||||
emit emptyGroupCreated(groupNumber, getGroupPersistentId(groupNumber), name);
|
if (toxav_groupchat_enable_av(tox.get(), groupNumber, CoreAV::groupCallCallback, this)) {
|
||||||
|
qCritical() << "Failed to enable audio on loaded group" << groupNumber;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
emit emptyGroupCreated(groupNumber, persistentId, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
delete[] groupNumbers;
|
delete[] groupNumbers;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user