diff options
author | Alexey Rusakov <Kitsune-Ral@users.sf.net> | 2021-08-07 22:13:42 +0200 |
---|---|---|
committer | Alexey Rusakov <Kitsune-Ral@users.sf.net> | 2021-08-07 22:25:17 +0200 |
commit | e5a760371a158bec6a70353b96614611adecc4bc (patch) | |
tree | e0ac5a6eaf1e0aa72c31b397fa82b6a96c1784e8 /lib/user.cpp | |
parent | bd649c591fa020fde0bd56a63c13025097b831ae (diff) | |
download | libquotient-e5a760371a158bec6a70353b96614611adecc4bc.tar.gz libquotient-e5a760371a158bec6a70353b96614611adecc4bc.zip |
Update non-generated code to work with QUrls in CS API
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 04afed2b..797576db 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); } |