Browse Source

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

reviewable/pr5480/r3
Monsterovich 7 years ago
parent
commit
72bcc6acaf
  1. 3
      src/widget/form/genericchatform.cpp

3
src/widget/form/genericchatform.cpp

@ -377,7 +377,8 @@ ChatMessage::Ptr GenericChatForm::createMessage(const ToxPk& author, const QStri @@ -377,7 +377,8 @@ ChatMessage::Ptr GenericChatForm::createMessage(const ToxPk& author, const QStri
{
const Core* core = Core::getInstance();
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()) {
addSystemDateMessage();
}

Loading…
Cancel
Save