From a4bcc4c95768e919d6b37fa3593104d71ad8ae22 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Wed, 29 Jul 2020 16:11:55 +0200 Subject: 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. --- lib/user.cpp | 2 -- 1 file changed, 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); } } -- cgit v1.2.3