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

fix(core): if your username is empty, use toxPK instead in groups

This commit is contained in:
Monsterovich 2019-01-05 23:21:39 +02:00
parent 066bdc5cc1
commit 72bcc6acaf

View File

@ -377,7 +377,8 @@ ChatMessage::Ptr GenericChatForm::createMessage(const ToxPk& author, const QStri
{ {
const Core* core = Core::getInstance(); const Core* core = Core::getInstance();
bool isSelf = author == core->getSelfId().getPublicKey(); bool isSelf = author == core->getSelfId().getPublicKey();
QString authorStr = isSelf ? core->getUsername() : resolveToxPk(author); QString myNickName = core->getUsername().isEmpty() ? author.toString() : core->getUsername();
QString authorStr = isSelf ? myNickName : resolveToxPk(author);
if (getLatestDate() != QDate::currentDate()) { if (getLatestDate() != QDate::currentDate()) {
addSystemDateMessage(); addSystemDateMessage();
} }