diff options
author | Alexey Rusakov <Kitsune-Ral@users.sf.net> | 2021-08-09 22:58:21 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-09 22:58:21 +0200 |
commit | 5d9443fccf2d336f16d6beacb5e1775c79123c02 (patch) | |
tree | fe5ba377808dfa7c3564dbe013e9894035c303f4 /lib/user.cpp | |
parent | bf6303c41264d913ca049009034aa948464b8f30 (diff) | |
parent | e5a760371a158bec6a70353b96614611adecc4bc (diff) | |
download | libquotient-5d9443fccf2d336f16d6beacb5e1775c79123c02.tar.gz libquotient-5d9443fccf2d336f16d6beacb5e1775c79123c02.zip |
Merge pull request #492 from quotient-im/kitsune-qurl-in-csapi
Use QUrl in CS API backend
Diffstat (limited to 'lib/user.cpp')
-rw-r--r-- | lib/user.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/user.cpp b/lib/user.cpp index a7e0efd9..a4abed37 100644 --- a/lib/user.cpp +++ b/lib/user.cpp @@ -135,17 +135,17 @@ template <typename SourceT> inline bool User::doSetAvatar(SourceT&& source) { return d->defaultAvatar.upload( - connection(), source, [this](const QString& contentUri) { + connection(), source, [this](const QUrl& contentUri) { auto* j = connection()->callApi<SetAvatarUrlJob>(id(), contentUri); connect(j, &BaseJob::success, this, - [this, newUrl = QUrl(contentUri)] { - if (newUrl == d->defaultAvatar.url()) { - d->defaultAvatar.updateUrl(newUrl); + [this, contentUri] { + if (contentUri == d->defaultAvatar.url()) { + d->defaultAvatar.updateUrl(contentUri); emit defaultAvatarChanged(); } else qCWarning(MAIN) << "User" << id() << "already has avatar URL set to" - << newUrl.toDisplayString(); + << contentUri.toDisplayString(); }); }); } @@ -162,7 +162,7 @@ bool User::setAvatar(QIODevice* source) void User::removeAvatar() { - connection()->callApi<SetAvatarUrlJob>(id(), ""); + connection()->callApi<SetAvatarUrlJob>(id(), QUrl()); } void User::requestDirectChat() { connection()->requestDirectChat(this); } |