diff options
author | Alexey Rusakov <Kitsune-Ral@users.sf.net> | 2021-07-31 22:07:29 +0200 |
---|---|---|
committer | Alexey Rusakov <Kitsune-Ral@users.sf.net> | 2021-07-31 22:07:29 +0200 |
commit | 8398e7118503d51da431ba850812ec76d1976b67 (patch) | |
tree | 123ca4cd31fc544c67fff1b0cb5e39b18f98ce8d /lib/user.cpp | |
parent | 240ab55c1ec700d5d9c5456fe120c4af17767778 (diff) | |
download | libquotient-8398e7118503d51da431ba850812ec76d1976b67.tar.gz libquotient-8398e7118503d51da431ba850812ec76d1976b67.zip |
Fix lack of percent encoding in User::fetchProfile
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.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/user.cpp b/lib/user.cpp index f0831733..4e369a4f 100644 --- a/lib/user.cpp +++ b/lib/user.cpp @@ -71,7 +71,9 @@ void User::Private::fetchProfile(const User* q) { defaultAvatar.emplace(Avatar {}); defaultName = ""; - auto* j = q->connection()->callApi<GetUserProfileJob>(BackgroundRequest, id); + auto* j = + q->connection()->callApi<GetUserProfileJob>(BackgroundRequest, + QUrl::toPercentEncoding(id)); // FIXME: accepting const User* and const_cast'ing it here is only // until we get a better User API in 0.7 QObject::connect(j, &BaseJob::success, q, |