aboutsummaryrefslogtreecommitdiff
path: root/lib/connection.cpp
diff options
context:
space:
mode:
authorAlexey Rusakov <Kitsune-Ral@users.sf.net>2021-09-10 22:38:10 +0200
committerAlexey Rusakov <Kitsune-Ral@users.sf.net>2021-09-10 22:44:06 +0200
commit2bf18a64d236c2364e12d4c2f1a9464cc6a2ebf9 (patch)
tree25dfe59097bc284891231263e992cbffbce3661d /lib/connection.cpp
parentdf46414a4e16d608049610935aeabab222e06d72 (diff)
downloadlibquotient-2bf18a64d236c2364e12d4c2f1a9464cc6a2ebf9.tar.gz
libquotient-2bf18a64d236c2364e12d4c2f1a9464cc6a2ebf9.zip
Move URL creation to Room/Connection; use query instead of fragment
The query is easier to manipulate; and the original mxc URL is not used for the real network request anyway.
Diffstat (limited to 'lib/connection.cpp')
-rw-r--r--lib/connection.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/connection.cpp b/lib/connection.cpp
index 222c3b71..51946b2f 100644
--- a/lib/connection.cpp
+++ b/lib/connection.cpp
@@ -836,6 +836,15 @@ inline auto splitMediaId(const QString& mediaId)
return idParts;
}
+QUrl Connection::makeMediaUrl(QUrl mxcUrl) const
+{
+ Q_ASSERT(mxcUrl.scheme() == "mxc");
+ QUrlQuery q(mxcUrl.query());
+ q.addQueryItem(QStringLiteral("user_id"), userId());
+ mxcUrl.setQuery(q);
+ return mxcUrl;
+}
+
MediaThumbnailJob* Connection::getThumbnail(const QString& mediaId,
QSize requestedSize,
RunningPolicy policy)