aboutsummaryrefslogtreecommitdiff
path: root/lib/user.cpp
diff options
context:
space:
mode:
authorAlexey Rusakov <Kitsune-Ral@users.sf.net>2021-08-02 09:04:06 +0200
committerAlexey Rusakov <Kitsune-Ral@users.sf.net>2021-08-02 09:04:06 +0200
commit72643d2f90aa929ec5e44159f717057fdad56cbd (patch)
tree15fcc631aaa72e04201196cec5b2e48c57e67c54 /lib/user.cpp
parentea1e849f617f62b3d209b2019e0daa3c6bed50f0 (diff)
downloadlibquotient-72643d2f90aa929ec5e44159f717057fdad56cbd.tar.gz
libquotient-72643d2f90aa929ec5e44159f717057fdad56cbd.zip
Fix lack of percent encoding in User::load()
Users with slashes in their ids do it at their own peril of course but to encode the id in the URL is a good thing in any case. Too bad it's pretty invisible and has to be dealt with case by case, instead of GTAD magically sticking QUrl::toPercentEncoding() where appropriate in the generated code.
Diffstat (limited to 'lib/user.cpp')
-rw-r--r--lib/user.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/user.cpp b/lib/user.cpp
index c97e33a4..04afed2b 100644
--- a/lib/user.cpp
+++ b/lib/user.cpp
@@ -65,7 +65,8 @@ User::~User() = default;
void User::load()
{
- auto *profileJob = connection()->callApi<GetUserProfileJob>(id());
+ auto* profileJob =
+ connection()->callApi<GetUserProfileJob>(QUrl::toPercentEncoding(id()));
connect(profileJob, &BaseJob::result, this, [this, profileJob] {
d->defaultName = profileJob->displayname();
d->defaultAvatar = Avatar(QUrl(profileJob->avatarUrl()));