aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--user.cpp10
-rw-r--r--user.h2
2 files changed, 7 insertions, 5 deletions
diff --git a/user.cpp b/user.cpp
index 7caf54e2..171d6d6c 100644
--- a/user.cpp
+++ b/user.cpp
@@ -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();
diff --git a/user.h b/user.h
index cf7d4e0a..79a6f5db 100644
--- a/user.h
+++ b/user.h
@@ -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;