From aacc4bcb4a487871daae6717f77605aaba444341 Mon Sep 17 00:00:00 2001 From: Marc Deop Date: Sat, 2 Mar 2019 12:26:57 +0100 Subject: style: apply .clang-format to all .cpp and .h files --- lib/csapi/account-data.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'lib/csapi/account-data.cpp') diff --git a/lib/csapi/account-data.cpp b/lib/csapi/account-data.cpp index 5021c73a..40388673 100644 --- a/lib/csapi/account-data.cpp +++ b/lib/csapi/account-data.cpp @@ -14,19 +14,24 @@ static const auto basePath = QStringLiteral("/_matrix/client/r0"); static const auto SetAccountDataJobName = QStringLiteral("SetAccountDataJob"); -SetAccountDataJob::SetAccountDataJob(const QString& userId, const QString& type, const QJsonObject& content) +SetAccountDataJob::SetAccountDataJob(const QString& userId, const QString& type, + const QJsonObject& content) : BaseJob(HttpVerb::Put, SetAccountDataJobName, - basePath % "/user/" % userId % "/account_data/" % type) + basePath % "/user/" % userId % "/account_data/" % type) { setRequestData(Data(toJson(content))); } -static const auto SetAccountDataPerRoomJobName = QStringLiteral("SetAccountDataPerRoomJob"); +static const auto SetAccountDataPerRoomJobName = + QStringLiteral("SetAccountDataPerRoomJob"); -SetAccountDataPerRoomJob::SetAccountDataPerRoomJob(const QString& userId, const QString& roomId, const QString& type, const QJsonObject& content) +SetAccountDataPerRoomJob::SetAccountDataPerRoomJob(const QString& userId, + const QString& roomId, + const QString& type, + const QJsonObject& content) : BaseJob(HttpVerb::Put, SetAccountDataPerRoomJobName, - basePath % "/user/" % userId % "/rooms/" % roomId % "/account_data/" % type) + basePath % "/user/" % userId % "/rooms/" % roomId + % "/account_data/" % type) { setRequestData(Data(toJson(content))); } - -- cgit v1.2.3 From 01d9f7b3f1785034503497798fb732ee6ee5fba3 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Sat, 23 Mar 2019 15:51:04 +0900 Subject: Update to the latest CS API definitions No breaking changes; GetAccountDataJob/GetAccountDataPerRoomJob added. --- lib/csapi/account-data.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'lib/csapi/account-data.cpp') diff --git a/lib/csapi/account-data.cpp b/lib/csapi/account-data.cpp index 5021c73a..96b32a92 100644 --- a/lib/csapi/account-data.cpp +++ b/lib/csapi/account-data.cpp @@ -21,6 +21,20 @@ SetAccountDataJob::SetAccountDataJob(const QString& userId, const QString& type, setRequestData(Data(toJson(content))); } +QUrl GetAccountDataJob::makeRequestUrl(QUrl baseUrl, const QString& userId, const QString& type) +{ + return BaseJob::makeRequestUrl(std::move(baseUrl), + basePath % "/user/" % userId % "/account_data/" % type); +} + +static const auto GetAccountDataJobName = QStringLiteral("GetAccountDataJob"); + +GetAccountDataJob::GetAccountDataJob(const QString& userId, const QString& type) + : BaseJob(HttpVerb::Get, GetAccountDataJobName, + basePath % "/user/" % userId % "/account_data/" % type) +{ +} + static const auto SetAccountDataPerRoomJobName = QStringLiteral("SetAccountDataPerRoomJob"); SetAccountDataPerRoomJob::SetAccountDataPerRoomJob(const QString& userId, const QString& roomId, const QString& type, const QJsonObject& content) @@ -30,3 +44,17 @@ SetAccountDataPerRoomJob::SetAccountDataPerRoomJob(const QString& userId, const setRequestData(Data(toJson(content))); } +QUrl GetAccountDataPerRoomJob::makeRequestUrl(QUrl baseUrl, const QString& userId, const QString& roomId, const QString& type) +{ + return BaseJob::makeRequestUrl(std::move(baseUrl), + basePath % "/user/" % userId % "/rooms/" % roomId % "/account_data/" % type); +} + +static const auto GetAccountDataPerRoomJobName = QStringLiteral("GetAccountDataPerRoomJob"); + +GetAccountDataPerRoomJob::GetAccountDataPerRoomJob(const QString& userId, const QString& roomId, const QString& type) + : BaseJob(HttpVerb::Get, GetAccountDataPerRoomJobName, + basePath % "/user/" % userId % "/rooms/" % roomId % "/account_data/" % type) +{ +} + -- cgit v1.2.3 From 27ca32a1e5a56e09b9cc1d94224d2831004dcf3d Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Sun, 7 Jul 2019 19:32:34 +0900 Subject: Namespace: QMatrixClient -> Quotient (with back comp alias) --- lib/csapi/account-data.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/csapi/account-data.cpp') diff --git a/lib/csapi/account-data.cpp b/lib/csapi/account-data.cpp index 7d4f1ad7..2e466fa3 100644 --- a/lib/csapi/account-data.cpp +++ b/lib/csapi/account-data.cpp @@ -8,7 +8,7 @@ #include -using namespace QMatrixClient; +using namespace Quotient; static const auto basePath = QStringLiteral("/_matrix/client/r0"); -- cgit v1.2.3 From 7036ed0dcb137cb5cbb6b426dd338c5e2e4c6424 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Fri, 17 Apr 2020 07:42:13 +0200 Subject: Regenerate API files using new GTAD and refreshed templates No functional changes. --- lib/csapi/account-data.cpp | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) (limited to 'lib/csapi/account-data.cpp') diff --git a/lib/csapi/account-data.cpp b/lib/csapi/account-data.cpp index 2e466fa3..b7825718 100644 --- a/lib/csapi/account-data.cpp +++ b/lib/csapi/account-data.cpp @@ -12,11 +12,9 @@ using namespace Quotient; static const auto basePath = QStringLiteral("/_matrix/client/r0"); -static const auto SetAccountDataJobName = QStringLiteral("SetAccountDataJob"); - SetAccountDataJob::SetAccountDataJob(const QString& userId, const QString& type, const QJsonObject& content) - : BaseJob(HttpVerb::Put, SetAccountDataJobName, + : BaseJob(HttpVerb::Put, QStringLiteral("SetAccountDataJob"), basePath % "/user/" % userId % "/account_data/" % type) { setRequestData(Data(toJson(content))); @@ -30,21 +28,16 @@ QUrl GetAccountDataJob::makeRequestUrl(QUrl baseUrl, const QString& userId, % "/account_data/" % type); } -static const auto GetAccountDataJobName = QStringLiteral("GetAccountDataJob"); - GetAccountDataJob::GetAccountDataJob(const QString& userId, const QString& type) - : BaseJob(HttpVerb::Get, GetAccountDataJobName, + : BaseJob(HttpVerb::Get, QStringLiteral("GetAccountDataJob"), basePath % "/user/" % userId % "/account_data/" % type) {} -static const auto SetAccountDataPerRoomJobName = - QStringLiteral("SetAccountDataPerRoomJob"); - SetAccountDataPerRoomJob::SetAccountDataPerRoomJob(const QString& userId, const QString& roomId, const QString& type, const QJsonObject& content) - : BaseJob(HttpVerb::Put, SetAccountDataPerRoomJobName, + : BaseJob(HttpVerb::Put, QStringLiteral("SetAccountDataPerRoomJob"), basePath % "/user/" % userId % "/rooms/" % roomId % "/account_data/" % type) { @@ -61,13 +54,10 @@ QUrl GetAccountDataPerRoomJob::makeRequestUrl(QUrl baseUrl, % roomId % "/account_data/" % type); } -static const auto GetAccountDataPerRoomJobName = - QStringLiteral("GetAccountDataPerRoomJob"); - GetAccountDataPerRoomJob::GetAccountDataPerRoomJob(const QString& userId, const QString& roomId, const QString& type) - : BaseJob(HttpVerb::Get, GetAccountDataPerRoomJobName, + : BaseJob(HttpVerb::Get, QStringLiteral("GetAccountDataPerRoomJob"), basePath % "/user/" % userId % "/rooms/" % roomId % "/account_data/" % type) {} -- cgit v1.2.3 From 32729d9a7519cd2c4cddb0174b8329c6fd4a4a83 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Sun, 7 Jun 2020 19:46:40 +0200 Subject: Update generated files according to gtad/* changes --- lib/csapi/account-data.cpp | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) (limited to 'lib/csapi/account-data.cpp') diff --git a/lib/csapi/account-data.cpp b/lib/csapi/account-data.cpp index b7825718..6a40e908 100644 --- a/lib/csapi/account-data.cpp +++ b/lib/csapi/account-data.cpp @@ -4,18 +4,15 @@ #include "account-data.h" -#include "converters.h" - #include using namespace Quotient; -static const auto basePath = QStringLiteral("/_matrix/client/r0"); - SetAccountDataJob::SetAccountDataJob(const QString& userId, const QString& type, const QJsonObject& content) : BaseJob(HttpVerb::Put, QStringLiteral("SetAccountDataJob"), - basePath % "/user/" % userId % "/account_data/" % type) + QStringLiteral("/_matrix/client/r0") % "/user/" % userId + % "/account_data/" % type) { setRequestData(Data(toJson(content))); } @@ -24,13 +21,14 @@ QUrl GetAccountDataJob::makeRequestUrl(QUrl baseUrl, const QString& userId, const QString& type) { return BaseJob::makeRequestUrl(std::move(baseUrl), - basePath % "/user/" % userId - % "/account_data/" % type); + QStringLiteral("/_matrix/client/r0") % "/user/" + % userId % "/account_data/" % type); } GetAccountDataJob::GetAccountDataJob(const QString& userId, const QString& type) : BaseJob(HttpVerb::Get, QStringLiteral("GetAccountDataJob"), - basePath % "/user/" % userId % "/account_data/" % type) + QStringLiteral("/_matrix/client/r0") % "/user/" % userId + % "/account_data/" % type) {} SetAccountDataPerRoomJob::SetAccountDataPerRoomJob(const QString& userId, @@ -38,8 +36,8 @@ SetAccountDataPerRoomJob::SetAccountDataPerRoomJob(const QString& userId, const QString& type, const QJsonObject& content) : BaseJob(HttpVerb::Put, QStringLiteral("SetAccountDataPerRoomJob"), - basePath % "/user/" % userId % "/rooms/" % roomId - % "/account_data/" % type) + QStringLiteral("/_matrix/client/r0") % "/user/" % userId + % "/rooms/" % roomId % "/account_data/" % type) { setRequestData(Data(toJson(content))); } @@ -50,14 +48,15 @@ QUrl GetAccountDataPerRoomJob::makeRequestUrl(QUrl baseUrl, const QString& type) { return BaseJob::makeRequestUrl(std::move(baseUrl), - basePath % "/user/" % userId % "/rooms/" - % roomId % "/account_data/" % type); + QStringLiteral("/_matrix/client/r0") + % "/user/" % userId % "/rooms/" % roomId + % "/account_data/" % type); } GetAccountDataPerRoomJob::GetAccountDataPerRoomJob(const QString& userId, const QString& roomId, const QString& type) : BaseJob(HttpVerb::Get, QStringLiteral("GetAccountDataPerRoomJob"), - basePath % "/user/" % userId % "/rooms/" % roomId - % "/account_data/" % type) + QStringLiteral("/_matrix/client/r0") % "/user/" % userId + % "/rooms/" % roomId % "/account_data/" % type) {} -- cgit v1.2.3