aboutsummaryrefslogtreecommitdiff
path: root/lib/user.cpp
diff options
context:
space:
mode:
authorAlexey Rusakov <Kitsune-Ral@users.sf.net>2021-08-09 22:58:21 +0200
committerGitHub <noreply@github.com>2021-08-09 22:58:21 +0200
commit5d9443fccf2d336f16d6beacb5e1775c79123c02 (patch)
treefe5ba377808dfa7c3564dbe013e9894035c303f4 /lib/user.cpp
parentbf6303c41264d913ca049009034aa948464b8f30 (diff)
parente5a760371a158bec6a70353b96614611adecc4bc (diff)
downloadlibquotient-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.cpp12
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); }