aboutsummaryrefslogtreecommitdiff
path: root/lib/csapi/content-repo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/csapi/content-repo.cpp')
-rw-r--r--lib/csapi/content-repo.cpp29
1 files changed, 15 insertions, 14 deletions
diff --git a/lib/csapi/content-repo.cpp b/lib/csapi/content-repo.cpp
index 6d1e38b6..6f6738af 100644
--- a/lib/csapi/content-repo.cpp
+++ b/lib/csapi/content-repo.cpp
@@ -16,11 +16,11 @@ auto queryToUploadContent(const QString& filename)
UploadContentJob::UploadContentJob(QIODevice* content, const QString& filename,
const QString& contentType)
: BaseJob(HttpVerb::Post, QStringLiteral("UploadContentJob"),
- makePath("/_matrix/media/r0", "/upload"),
+ makePath("/_matrix/media/v3", "/upload"),
queryToUploadContent(filename))
{
setRequestHeader("Content-Type", contentType.toLatin1());
- setRequestData(RequestData(content));
+ setRequestData({ content });
addExpectedKey("content_uri");
}
@@ -35,7 +35,7 @@ QUrl GetContentJob::makeRequestUrl(QUrl baseUrl, const QString& serverName,
const QString& mediaId, bool allowRemote)
{
return BaseJob::makeRequestUrl(std::move(baseUrl),
- makePath("/_matrix/media/r0", "/download/",
+ makePath("/_matrix/media/v3", "/download/",
serverName, "/", mediaId),
queryToGetContent(allowRemote));
}
@@ -43,7 +43,7 @@ QUrl GetContentJob::makeRequestUrl(QUrl baseUrl, const QString& serverName,
GetContentJob::GetContentJob(const QString& serverName, const QString& mediaId,
bool allowRemote)
: BaseJob(HttpVerb::Get, QStringLiteral("GetContentJob"),
- makePath("/_matrix/media/r0", "/download/", serverName, "/",
+ makePath("/_matrix/media/v3", "/download/", serverName, "/",
mediaId),
queryToGetContent(allowRemote), {}, false)
{
@@ -64,7 +64,7 @@ QUrl GetContentOverrideNameJob::makeRequestUrl(QUrl baseUrl,
bool allowRemote)
{
return BaseJob::makeRequestUrl(std::move(baseUrl),
- makePath("/_matrix/media/r0", "/download/",
+ makePath("/_matrix/media/v3", "/download/",
serverName, "/", mediaId, "/",
fileName),
queryToGetContentOverrideName(allowRemote));
@@ -75,7 +75,7 @@ GetContentOverrideNameJob::GetContentOverrideNameJob(const QString& serverName,
const QString& fileName,
bool allowRemote)
: BaseJob(HttpVerb::Get, QStringLiteral("GetContentOverrideNameJob"),
- makePath("/_matrix/media/r0", "/download/", serverName, "/",
+ makePath("/_matrix/media/v3", "/download/", serverName, "/",
mediaId, "/", fileName),
queryToGetContentOverrideName(allowRemote), {}, false)
{
@@ -101,16 +101,17 @@ QUrl GetContentThumbnailJob::makeRequestUrl(QUrl baseUrl,
{
return BaseJob::makeRequestUrl(
std::move(baseUrl),
- makePath("/_matrix/media/r0", "/thumbnail/", serverName, "/", mediaId),
+ makePath("/_matrix/media/v3", "/thumbnail/", serverName, "/", mediaId),
queryToGetContentThumbnail(width, height, method, allowRemote));
}
GetContentThumbnailJob::GetContentThumbnailJob(const QString& serverName,
- const QString& mediaId, int width,
- int height, const QString& method,
+ const QString& mediaId,
+ int width, int height,
+ const QString& method,
bool allowRemote)
: BaseJob(HttpVerb::Get, QStringLiteral("GetContentThumbnailJob"),
- makePath("/_matrix/media/r0", "/thumbnail/", serverName, "/",
+ makePath("/_matrix/media/v3", "/thumbnail/", serverName, "/",
mediaId),
queryToGetContentThumbnail(width, height, method, allowRemote),
{}, false)
@@ -130,24 +131,24 @@ QUrl GetUrlPreviewJob::makeRequestUrl(QUrl baseUrl, const QUrl& url,
Omittable<qint64> ts)
{
return BaseJob::makeRequestUrl(std::move(baseUrl),
- makePath("/_matrix/media/r0",
+ makePath("/_matrix/media/v3",
"/preview_url"),
queryToGetUrlPreview(url, ts));
}
GetUrlPreviewJob::GetUrlPreviewJob(const QUrl& url, Omittable<qint64> ts)
: BaseJob(HttpVerb::Get, QStringLiteral("GetUrlPreviewJob"),
- makePath("/_matrix/media/r0", "/preview_url"),
+ makePath("/_matrix/media/v3", "/preview_url"),
queryToGetUrlPreview(url, ts))
{}
QUrl GetConfigJob::makeRequestUrl(QUrl baseUrl)
{
return BaseJob::makeRequestUrl(std::move(baseUrl),
- makePath("/_matrix/media/r0", "/config"));
+ makePath("/_matrix/media/v3", "/config"));
}
GetConfigJob::GetConfigJob()
: BaseJob(HttpVerb::Get, QStringLiteral("GetConfigJob"),
- makePath("/_matrix/media/r0", "/config"))
+ makePath("/_matrix/media/v3", "/config"))
{}