diff options
author | Alexey Rusakov <Kitsune-Ral@users.sf.net> | 2021-09-12 06:16:25 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-12 06:16:25 +0200 |
commit | 41944ac3ee76029201c2108a063ae2b6354f6a22 (patch) | |
tree | 661559b8a51868ae54fbb58104ad49ca8900b2de /lib/room.cpp | |
parent | 9da6b25a26403952e5a76b043076ba302c8d3c30 (diff) | |
parent | bcaab611840a0a2ad284e6f1e7c2f0b4de10222d (diff) | |
download | libquotient-41944ac3ee76029201c2108a063ae2b6354f6a22.tar.gz libquotient-41944ac3ee76029201c2108a063ae2b6354f6a22.zip |
Merge pull request #499 from TobiasFella/mxcnam
Implement the mxc protocol in the NetworkAccessManager
Diffstat (limited to 'lib/room.cpp')
-rw-r--r-- | lib/room.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/room.cpp b/lib/room.cpp index c6cca2ea..bcbb121b 100644 --- a/lib/room.cpp +++ b/lib/room.cpp @@ -1116,6 +1116,17 @@ QList<User*> Room::directChatUsers() const return connection()->directChatUsers(this); } +QUrl Room::makeMediaUrl(const QString& eventId, const QUrl& mxcUrl) const +{ + auto url = connection()->makeMediaUrl(mxcUrl); + QUrlQuery q(url.query()); + Q_ASSERT(q.hasQueryItem("user_id")); + q.addQueryItem("room_id", id()); + q.addQueryItem("event_id", eventId); + url.setQuery(q); + return url; +} + QString safeFileName(QString rawName) { return rawName.replace(QRegularExpression("[/\\<>|\"*?:]"), "_"); |