aboutsummaryrefslogtreecommitdiff
path: root/lib/csapi/keys.cpp
diff options
context:
space:
mode:
authorarawaaa <77910862+arawaaa@users.noreply.github.com>2021-12-27 17:35:28 -0600
committerGitHub <noreply@github.com>2021-12-27 17:35:28 -0600
commit7ec3ba834dd313c4408622da30e04cdc6f4cf7c7 (patch)
tree679d7dc5939a229ad46676cd1d7aeaea7a25abce /lib/csapi/keys.cpp
parent17bf4d180297c7e87363e179b8afa79ddb15dca7 (diff)
parent674e984e459375974f619d0e778d43a2cc928dc3 (diff)
downloadlibquotient-7ec3ba834dd313c4408622da30e04cdc6f4cf7c7.tar.gz
libquotient-7ec3ba834dd313c4408622da30e04cdc6f4cf7c7.zip
Merge branch 'dev' into pinned
Diffstat (limited to 'lib/csapi/keys.cpp')
-rw-r--r--lib/csapi/keys.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/lib/csapi/keys.cpp b/lib/csapi/keys.cpp
index 34ab47c9..d6bd2fab 100644
--- a/lib/csapi/keys.cpp
+++ b/lib/csapi/keys.cpp
@@ -4,14 +4,12 @@
#include "keys.h"
-#include <QtCore/QStringBuilder>
-
using namespace Quotient;
UploadKeysJob::UploadKeysJob(const Omittable<DeviceKeys>& deviceKeys,
const QHash<QString, QVariant>& oneTimeKeys)
: BaseJob(HttpVerb::Post, QStringLiteral("UploadKeysJob"),
- QStringLiteral("/_matrix/client/r0") % "/keys/upload")
+ makePath("/_matrix/client/r0", "/keys/upload"))
{
QJsonObject _data;
addParam<IfNotEmpty>(_data, QStringLiteral("device_keys"), deviceKeys);
@@ -23,7 +21,7 @@ UploadKeysJob::UploadKeysJob(const Omittable<DeviceKeys>& deviceKeys,
QueryKeysJob::QueryKeysJob(const QHash<QString, QStringList>& deviceKeys,
Omittable<int> timeout, const QString& token)
: BaseJob(HttpVerb::Post, QStringLiteral("QueryKeysJob"),
- QStringLiteral("/_matrix/client/r0") % "/keys/query")
+ makePath("/_matrix/client/r0", "/keys/query"))
{
QJsonObject _data;
addParam<IfNotEmpty>(_data, QStringLiteral("timeout"), timeout);
@@ -36,7 +34,7 @@ ClaimKeysJob::ClaimKeysJob(
const QHash<QString, QHash<QString, QString>>& oneTimeKeys,
Omittable<int> timeout)
: BaseJob(HttpVerb::Post, QStringLiteral("ClaimKeysJob"),
- QStringLiteral("/_matrix/client/r0") % "/keys/claim")
+ makePath("/_matrix/client/r0", "/keys/claim"))
{
QJsonObject _data;
addParam<IfNotEmpty>(_data, QStringLiteral("timeout"), timeout);
@@ -47,7 +45,7 @@ ClaimKeysJob::ClaimKeysJob(
auto queryToGetKeysChanges(const QString& from, const QString& to)
{
- BaseJob::Query _q;
+ QUrlQuery _q;
addParam<>(_q, QStringLiteral("from"), from);
addParam<>(_q, QStringLiteral("to"), to);
return _q;
@@ -57,13 +55,13 @@ QUrl GetKeysChangesJob::makeRequestUrl(QUrl baseUrl, const QString& from,
const QString& to)
{
return BaseJob::makeRequestUrl(std::move(baseUrl),
- QStringLiteral("/_matrix/client/r0")
- % "/keys/changes",
+ makePath("/_matrix/client/r0",
+ "/keys/changes"),
queryToGetKeysChanges(from, to));
}
GetKeysChangesJob::GetKeysChangesJob(const QString& from, const QString& to)
: BaseJob(HttpVerb::Get, QStringLiteral("GetKeysChangesJob"),
- QStringLiteral("/_matrix/client/r0") % "/keys/changes",
+ makePath("/_matrix/client/r0", "/keys/changes"),
queryToGetKeysChanges(from, to))
{}