aboutsummaryrefslogtreecommitdiff
path: root/lib/csapi/pushrules.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/csapi/pushrules.cpp')
-rw-r--r--lib/csapi/pushrules.cpp48
1 files changed, 24 insertions, 24 deletions
diff --git a/lib/csapi/pushrules.cpp b/lib/csapi/pushrules.cpp
index 0d840788..2376654a 100644
--- a/lib/csapi/pushrules.cpp
+++ b/lib/csapi/pushrules.cpp
@@ -9,12 +9,12 @@ using namespace Quotient;
QUrl GetPushRulesJob::makeRequestUrl(QUrl baseUrl)
{
return BaseJob::makeRequestUrl(
- std::move(baseUrl), makePath("/_matrix/client/r0", "/pushrules"));
+ std::move(baseUrl), makePath("/_matrix/client/v3", "/pushrules"));
}
GetPushRulesJob::GetPushRulesJob()
: BaseJob(HttpVerb::Get, QStringLiteral("GetPushRulesJob"),
- makePath("/_matrix/client/r0", "/pushrules"))
+ makePath("/_matrix/client/v3", "/pushrules"))
{
addExpectedKey("global");
}
@@ -23,14 +23,14 @@ QUrl GetPushRuleJob::makeRequestUrl(QUrl baseUrl, const QString& scope,
const QString& kind, const QString& ruleId)
{
return BaseJob::makeRequestUrl(std::move(baseUrl),
- makePath("/_matrix/client/r0", "/pushrules/",
+ makePath("/_matrix/client/v3", "/pushrules/",
scope, "/", kind, "/", ruleId));
}
GetPushRuleJob::GetPushRuleJob(const QString& scope, const QString& kind,
const QString& ruleId)
: BaseJob(HttpVerb::Get, QStringLiteral("GetPushRuleJob"),
- makePath("/_matrix/client/r0", "/pushrules/", scope, "/", kind,
+ makePath("/_matrix/client/v3", "/pushrules/", scope, "/", kind,
"/", ruleId))
{}
@@ -39,14 +39,14 @@ QUrl DeletePushRuleJob::makeRequestUrl(QUrl baseUrl, const QString& scope,
const QString& ruleId)
{
return BaseJob::makeRequestUrl(std::move(baseUrl),
- makePath("/_matrix/client/r0", "/pushrules/",
+ makePath("/_matrix/client/v3", "/pushrules/",
scope, "/", kind, "/", ruleId));
}
DeletePushRuleJob::DeletePushRuleJob(const QString& scope, const QString& kind,
const QString& ruleId)
: BaseJob(HttpVerb::Delete, QStringLiteral("DeletePushRuleJob"),
- makePath("/_matrix/client/r0", "/pushrules/", scope, "/", kind,
+ makePath("/_matrix/client/v3", "/pushrules/", scope, "/", kind,
"/", ruleId))
{}
@@ -65,15 +65,15 @@ SetPushRuleJob::SetPushRuleJob(const QString& scope, const QString& kind,
const QVector<PushCondition>& conditions,
const QString& pattern)
: BaseJob(HttpVerb::Put, QStringLiteral("SetPushRuleJob"),
- makePath("/_matrix/client/r0", "/pushrules/", scope, "/", kind,
+ makePath("/_matrix/client/v3", "/pushrules/", scope, "/", kind,
"/", ruleId),
queryToSetPushRule(before, after))
{
- QJsonObject _data;
- addParam<>(_data, QStringLiteral("actions"), actions);
- addParam<IfNotEmpty>(_data, QStringLiteral("conditions"), conditions);
- addParam<IfNotEmpty>(_data, QStringLiteral("pattern"), pattern);
- setRequestData(std::move(_data));
+ QJsonObject _dataJson;
+ addParam<>(_dataJson, QStringLiteral("actions"), actions);
+ addParam<IfNotEmpty>(_dataJson, QStringLiteral("conditions"), conditions);
+ addParam<IfNotEmpty>(_dataJson, QStringLiteral("pattern"), pattern);
+ setRequestData({ _dataJson });
}
QUrl IsPushRuleEnabledJob::makeRequestUrl(QUrl baseUrl, const QString& scope,
@@ -81,7 +81,7 @@ QUrl IsPushRuleEnabledJob::makeRequestUrl(QUrl baseUrl, const QString& scope,
const QString& ruleId)
{
return BaseJob::makeRequestUrl(std::move(baseUrl),
- makePath("/_matrix/client/r0", "/pushrules/",
+ makePath("/_matrix/client/v3", "/pushrules/",
scope, "/", kind, "/", ruleId,
"/enabled"));
}
@@ -90,7 +90,7 @@ IsPushRuleEnabledJob::IsPushRuleEnabledJob(const QString& scope,
const QString& kind,
const QString& ruleId)
: BaseJob(HttpVerb::Get, QStringLiteral("IsPushRuleEnabledJob"),
- makePath("/_matrix/client/r0", "/pushrules/", scope, "/", kind,
+ makePath("/_matrix/client/v3", "/pushrules/", scope, "/", kind,
"/", ruleId, "/enabled"))
{
addExpectedKey("enabled");
@@ -100,12 +100,12 @@ SetPushRuleEnabledJob::SetPushRuleEnabledJob(const QString& scope,
const QString& kind,
const QString& ruleId, bool enabled)
: BaseJob(HttpVerb::Put, QStringLiteral("SetPushRuleEnabledJob"),
- makePath("/_matrix/client/r0", "/pushrules/", scope, "/", kind,
+ makePath("/_matrix/client/v3", "/pushrules/", scope, "/", kind,
"/", ruleId, "/enabled"))
{
- QJsonObject _data;
- addParam<>(_data, QStringLiteral("enabled"), enabled);
- setRequestData(std::move(_data));
+ QJsonObject _dataJson;
+ addParam<>(_dataJson, QStringLiteral("enabled"), enabled);
+ setRequestData({ _dataJson });
}
QUrl GetPushRuleActionsJob::makeRequestUrl(QUrl baseUrl, const QString& scope,
@@ -113,7 +113,7 @@ QUrl GetPushRuleActionsJob::makeRequestUrl(QUrl baseUrl, const QString& scope,
const QString& ruleId)
{
return BaseJob::makeRequestUrl(std::move(baseUrl),
- makePath("/_matrix/client/r0", "/pushrules/",
+ makePath("/_matrix/client/v3", "/pushrules/",
scope, "/", kind, "/", ruleId,
"/actions"));
}
@@ -122,7 +122,7 @@ GetPushRuleActionsJob::GetPushRuleActionsJob(const QString& scope,
const QString& kind,
const QString& ruleId)
: BaseJob(HttpVerb::Get, QStringLiteral("GetPushRuleActionsJob"),
- makePath("/_matrix/client/r0", "/pushrules/", scope, "/", kind,
+ makePath("/_matrix/client/v3", "/pushrules/", scope, "/", kind,
"/", ruleId, "/actions"))
{
addExpectedKey("actions");
@@ -133,10 +133,10 @@ SetPushRuleActionsJob::SetPushRuleActionsJob(const QString& scope,
const QString& ruleId,
const QVector<QVariant>& actions)
: BaseJob(HttpVerb::Put, QStringLiteral("SetPushRuleActionsJob"),
- makePath("/_matrix/client/r0", "/pushrules/", scope, "/", kind,
+ makePath("/_matrix/client/v3", "/pushrules/", scope, "/", kind,
"/", ruleId, "/actions"))
{
- QJsonObject _data;
- addParam<>(_data, QStringLiteral("actions"), actions);
- setRequestData(std::move(_data));
+ QJsonObject _dataJson;
+ addParam<>(_dataJson, QStringLiteral("actions"), actions);
+ setRequestData({ _dataJson });
}