aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2020-07-29 16:11:55 +0200
committerKitsune Ral <Kitsune-Ral@users.sf.net>2020-07-29 16:11:55 +0200
commita4bcc4c95768e919d6b37fa3593104d71ad8ae22 (patch)
tree3f888cb856e2a9fc4ebfa0643f63fda23c67c8a0
parent5557b68a01f1b0f2e8e169aacdbe74f89b14cde3 (diff)
downloadlibquotient-a4bcc4c95768e919d6b37fa3593104d71ad8ae22.tar.gz
libquotient-a4bcc4c95768e919d6b37fa3593104d71ad8ae22.zip
User: only set object name at initialisation
User::updateName() usually operates on a specific room; setting an object name from an arbitrary (whichever came last at any point in time) room member event for a given user does not look like a good idea. And having it in User::updateAvatar() seems to be a copy-paste fallout.
-rw-r--r--lib/user.cpp2
1 files changed, 0 insertions, 2 deletions
diff --git a/lib/user.cpp b/lib/user.cpp
index 03474b10..6e377de8 100644
--- a/lib/user.cpp
+++ b/lib/user.cpp
@@ -230,7 +230,6 @@ void User::updateName(const QString& newName, const QString& oldName,
if (newName != oldName) {
emit nameAboutToChange(newName, oldName, room);
d->setNameForRoom(room, newName, oldName);
- setObjectName(displayname());
emit nameChanged(newName, oldName, room);
}
}
@@ -242,7 +241,6 @@ void User::updateAvatarUrl(const QUrl& newUrl, const QUrl& oldUrl,
|| d->avatarsToRooms.contains(oldUrl, room));
if (newUrl != oldUrl) {
d->setAvatarForRoom(room, newUrl, oldUrl);
- setObjectName(displayname());
emit avatarChanged(this, room);
}
}