diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2017-10-17 17:11:25 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2017-10-17 17:11:25 +0900 |
commit | c1049d374a3c6d79750c57d2e1751d440df3d8cc (patch) | |
tree | 44ff770f6a1896e7e4b5ccf3ab851eebd2847e31 | |
parent | 1ae42237adcc5486e526ff3a9e93d0901940a74b (diff) | |
download | libquotient-c1049d374a3c6d79750c57d2e1751d440df3d8cc.tar.gz libquotient-c1049d374a3c6d79750c57d2e1751d440df3d8cc.zip |
Fixed a blunder leading to users not having names
If all users suddenly don't have names, update to this commit, delete your cache and run again. Issue since 2bf912d6e6ddd9ff81a92ff28ac8c4c1d8f2d7e1.
-rw-r--r-- | user.cpp | 10 | ||||
-rw-r--r-- | user.h | 2 |
2 files changed, 7 insertions, 5 deletions
@@ -80,11 +80,13 @@ QString User::name() const return d->name; } -void User::setName(const QString& newName) +void User::updateName(const QString& newName) { const auto oldName = name(); - if (d->name != oldName) + if (d->name != newName) { + qCDebug(MAIN) << "Renaming" << id() + << "from" << oldName << "to" << newName; d->name = newName; emit nameChanged(this, oldName); } @@ -93,7 +95,7 @@ void User::setName(const QString& newName) void User::rename(const QString& newName) { auto job = d->connection->callApi<SetDisplayNameJob>(id(), newName); - connect(job, &BaseJob::success, this, [=] { setName(newName); }); + connect(job, &BaseJob::success, this, [=] { updateName(newName); }); } QString User::displayname() const @@ -164,7 +166,7 @@ void User::processEvent(Event* event) d->bridged = match.captured(1); newName.truncate(match.capturedStart(0)); } - setName(newName); + updateName(newName); if( d->avatarUrl != e->avatarUrl() ) { d->avatarUrl = e->avatarUrl(); @@ -67,7 +67,7 @@ namespace QMatrixClient void avatarChanged(User* user); private slots: - void setName(const QString& newName); + void updateName(const QString& newName); private: class Private; |