aboutsummaryrefslogtreecommitdiff
path: root/jobs
diff options
context:
space:
mode:
Diffstat (limited to 'jobs')
-rw-r--r--jobs/downloadfilejob.cpp5
-rw-r--r--jobs/downloadfilejob.h3
-rw-r--r--jobs/mediathumbnailjob.cpp7
-rw-r--r--jobs/mediathumbnailjob.h4
4 files changed, 19 insertions, 0 deletions
diff --git a/jobs/downloadfilejob.cpp b/jobs/downloadfilejob.cpp
index 06fa3b48..07d14197 100644
--- a/jobs/downloadfilejob.cpp
+++ b/jobs/downloadfilejob.cpp
@@ -20,6 +20,11 @@ class DownloadFileJob::Private
QScopedPointer<QFile> tempFile;
};
+QUrl DownloadFileJob::makeRequestUrl(QUrl baseUrl, const QUrl& mxcUri)
+{
+ return makeRequestUrl(baseUrl, mxcUri.authority(), mxcUri.path().mid(1));
+}
+
DownloadFileJob::DownloadFileJob(const QString& serverName,
const QString& mediaId,
const QString& localFilename)
diff --git a/jobs/downloadfilejob.h b/jobs/downloadfilejob.h
index d798506c..1815a7c8 100644
--- a/jobs/downloadfilejob.h
+++ b/jobs/downloadfilejob.h
@@ -9,6 +9,9 @@ namespace QMatrixClient
public:
enum { FileError = BaseJob::UserDefinedError + 1 };
+ using GetContentJob::makeRequestUrl;
+ static QUrl makeRequestUrl(QUrl baseUrl, const QUrl& mxcUri);
+
DownloadFileJob(const QString& serverName, const QString& mediaId,
const QString& localFilename = {});
diff --git a/jobs/mediathumbnailjob.cpp b/jobs/mediathumbnailjob.cpp
index ec82f57b..261978ec 100644
--- a/jobs/mediathumbnailjob.cpp
+++ b/jobs/mediathumbnailjob.cpp
@@ -20,6 +20,13 @@
using namespace QMatrixClient;
+QUrl MediaThumbnailJob::makeRequestUrl(QUrl baseUrl,
+ const QUrl& mxcUri, QSize requestedSize)
+{
+ return makeRequestUrl(baseUrl, mxcUri.authority(), mxcUri.path().mid(1),
+ requestedSize.width(), requestedSize.height());
+}
+
MediaThumbnailJob::MediaThumbnailJob(const QString& serverName,
const QString& mediaId, QSize requestedSize)
: GetContentThumbnailJob(serverName, mediaId,
diff --git a/jobs/mediathumbnailjob.h b/jobs/mediathumbnailjob.h
index ef834cd7..6e0b94f3 100644
--- a/jobs/mediathumbnailjob.h
+++ b/jobs/mediathumbnailjob.h
@@ -27,6 +27,10 @@ namespace QMatrixClient
class MediaThumbnailJob: public GetContentThumbnailJob
{
public:
+ using GetContentThumbnailJob::makeRequestUrl;
+ static QUrl makeRequestUrl(QUrl baseUrl,
+ const QUrl& mxcUri, QSize requestedSize);
+
MediaThumbnailJob(const QString& serverName, const QString& mediaId,
QSize requestedSize);
MediaThumbnailJob(const QUrl& mxcUri, QSize requestedSize);