Browse Source

fix(name): Clear alias on name change so that name changes are visible

Temporary work around for #5013
reviewable/pr5015/r2
Anthony Bilinski 7 years ago
parent
commit
c2410e0a65
No known key found for this signature in database
GPG Key ID: 2AA8E0DA1B31FB3C
  1. 5
      src/model/friend.cpp

5
src/model/friend.cpp

@ -52,6 +52,11 @@ void Friend::setName(const QString& _name) @@ -52,6 +52,11 @@ void Friend::setName(const QString& _name)
// save old displayed name to be able to compare for changes
const auto oldDisplayed = getDisplayedName();
if (userName == userAlias) {
userAlias.clear(); // Because userAlias was set on name change before (issue #5013)
// we clear alias if equal to old name so that name change is visible.
// TODO: We should not modify alias on setName.
}
if (userName != name) {
userName = name;
emit nameChanged(friendId, name);

Loading…
Cancel
Save