aboutsummaryrefslogtreecommitdiff
path: root/lib/csapi/content-repo.h
diff options
context:
space:
mode:
authorAlexey Rusakov <Kitsune-Ral@users.sf.net>2021-08-10 08:18:17 +0200
committerAlexey Rusakov <Kitsune-Ral@users.sf.net>2021-10-10 20:46:01 +0200
commit01103222dc59526b37d594b93b0b1cd7473e3f6f (patch)
tree8e3b679377571fd9b9014afbe62eeba6249d42e2 /lib/csapi/content-repo.h
parent4f08c88d234119c2a76874ebd2b1433b81992427 (diff)
parent7b516cdf0b987e542b1e4cd4556ecb2bfbde3ff9 (diff)
downloadlibquotient-01103222dc59526b37d594b93b0b1cd7473e3f6f.tar.gz
libquotient-01103222dc59526b37d594b93b0b1cd7473e3f6f.zip
Merge branch 'master' into kitsune-fix-read-receipts-and-markers
Diffstat (limited to 'lib/csapi/content-repo.h')
-rw-r--r--lib/csapi/content-repo.h44
1 files changed, 10 insertions, 34 deletions
diff --git a/lib/csapi/content-repo.h b/lib/csapi/content-repo.h
index a41453b2..28409f5c 100644
--- a/lib/csapi/content-repo.h
+++ b/lib/csapi/content-repo.h
@@ -34,10 +34,7 @@ public:
/// The [MXC URI](/client-server-api/#matrix-content-mxc-uris) to the
/// uploaded content.
- QString contentUri() const
- {
- return loadFromJson<QString>("content_uri"_ls);
- }
+ QUrl contentUri() const { return loadFromJson<QUrl>("content_uri"_ls); }
};
/*! \brief Download content from the content repository.
@@ -72,10 +69,7 @@ public:
// Result properties
/// The content type of the file that was previously uploaded.
- QString contentType() const
- {
- return reply()->rawHeader("Content-Type");
- }
+ QString contentType() const { return reply()->rawHeader("Content-Type"); }
/// The name of the file that was previously uploaded, if set.
QString contentDisposition() const
@@ -84,10 +78,7 @@ public:
}
/// The content that was previously uploaded.
- QIODevice* data()
- {
- return reply();
- }
+ QIODevice* data() { return reply(); }
};
/*! \brief Download content from the content repository overriding the file name
@@ -132,10 +123,7 @@ public:
// Result properties
/// The content type of the file that was previously uploaded.
- QString contentType() const
- {
- return reply()->rawHeader("Content-Type");
- }
+ QString contentType() const { return reply()->rawHeader("Content-Type"); }
/// The `fileName` requested or the name of the file that was previously
/// uploaded, if set.
@@ -145,10 +133,7 @@ public:
}
/// The content that was previously uploaded.
- QIODevice* data()
- {
- return reply();
- }
+ QIODevice* data() { return reply(); }
};
/*! \brief Download a thumbnail of content from the content repository
@@ -202,16 +187,10 @@ public:
// Result properties
/// The content type of the thumbnail.
- QString contentType() const
- {
- return reply()->rawHeader("Content-Type");
- }
+ QString contentType() const { return reply()->rawHeader("Content-Type"); }
/// A thumbnail of the requested content.
- QIODevice* data()
- {
- return reply();
- }
+ QIODevice* data() { return reply(); }
};
/*! \brief Get information about a URL for a client
@@ -237,14 +216,14 @@ public:
* return a newer version if it does not have the requested version
* available.
*/
- explicit GetUrlPreviewJob(const QString& url, Omittable<qint64> ts = none);
+ explicit GetUrlPreviewJob(const QUrl& url, Omittable<qint64> ts = none);
/*! \brief Construct a URL without creating a full-fledged job object
*
* This function can be used when a URL for GetUrlPreviewJob
* is necessary but the job itself isn't.
*/
- static QUrl makeRequestUrl(QUrl baseUrl, const QString& url,
+ static QUrl makeRequestUrl(QUrl baseUrl, const QUrl& url,
Omittable<qint64> ts = none);
// Result properties
@@ -257,10 +236,7 @@ public:
/// An [MXC URI](/client-server-api/#matrix-content-mxc-uris) to the image.
/// Omitted if there is no image.
- QString ogImage() const
- {
- return loadFromJson<QString>("og:image"_ls);
- }
+ QUrl ogImage() const { return loadFromJson<QUrl>("og:image"_ls); }
};
/*! \brief Get the configuration for the content repository.