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/room_state.cpp | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'lib/csapi/room_state.cpp') diff --git a/lib/csapi/room_state.cpp b/lib/csapi/room_state.cpp index 3aa7d736..668a2931 100644 --- a/lib/csapi/room_state.cpp +++ b/lib/csapi/room_state.cpp @@ -15,25 +15,27 @@ static const auto basePath = QStringLiteral("/_matrix/client/r0"); class SetRoomStateWithKeyJob::Private { public: - QString eventId; + QString eventId; }; -static const auto SetRoomStateWithKeyJobName = QStringLiteral("SetRoomStateWithKeyJob"); +static const auto SetRoomStateWithKeyJobName = + QStringLiteral("SetRoomStateWithKeyJob"); -SetRoomStateWithKeyJob::SetRoomStateWithKeyJob(const QString& roomId, const QString& eventType, const QString& stateKey, const QJsonObject& body) +SetRoomStateWithKeyJob::SetRoomStateWithKeyJob(const QString& roomId, + const QString& eventType, + const QString& stateKey, + const QJsonObject& body) : BaseJob(HttpVerb::Put, SetRoomStateWithKeyJobName, - basePath % "/rooms/" % roomId % "/state/" % eventType % "/" % stateKey) - , d(new Private) + basePath % "/rooms/" % roomId % "/state/" % eventType % "/" + % stateKey), + d(new Private) { setRequestData(Data(toJson(body))); } SetRoomStateWithKeyJob::~SetRoomStateWithKeyJob() = default; -const QString& SetRoomStateWithKeyJob::eventId() const -{ - return d->eventId; -} +const QString& SetRoomStateWithKeyJob::eventId() const { return d->eventId; } BaseJob::Status SetRoomStateWithKeyJob::parseJson(const QJsonDocument& data) { @@ -45,25 +47,24 @@ BaseJob::Status SetRoomStateWithKeyJob::parseJson(const QJsonDocument& data) class SetRoomStateJob::Private { public: - QString eventId; + QString eventId; }; static const auto SetRoomStateJobName = QStringLiteral("SetRoomStateJob"); -SetRoomStateJob::SetRoomStateJob(const QString& roomId, const QString& eventType, const QJsonObject& body) +SetRoomStateJob::SetRoomStateJob(const QString& roomId, + const QString& eventType, + const QJsonObject& body) : BaseJob(HttpVerb::Put, SetRoomStateJobName, - basePath % "/rooms/" % roomId % "/state/" % eventType) - , d(new Private) + basePath % "/rooms/" % roomId % "/state/" % eventType), + d(new Private) { setRequestData(Data(toJson(body))); } SetRoomStateJob::~SetRoomStateJob() = default; -const QString& SetRoomStateJob::eventId() const -{ - return d->eventId; -} +const QString& SetRoomStateJob::eventId() const { return d->eventId; } BaseJob::Status SetRoomStateJob::parseJson(const QJsonDocument& data) { @@ -71,4 +72,3 @@ BaseJob::Status SetRoomStateJob::parseJson(const QJsonDocument& data) fromJson(json.value("event_id"_ls), d->eventId); return Success; } - -- 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/room_state.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/csapi/room_state.cpp') diff --git a/lib/csapi/room_state.cpp b/lib/csapi/room_state.cpp index ef4afcd0..bfcd6e17 100644 --- a/lib/csapi/room_state.cpp +++ b/lib/csapi/room_state.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/room_state.cpp | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'lib/csapi/room_state.cpp') diff --git a/lib/csapi/room_state.cpp b/lib/csapi/room_state.cpp index bfcd6e17..5973b06b 100644 --- a/lib/csapi/room_state.cpp +++ b/lib/csapi/room_state.cpp @@ -12,20 +12,16 @@ using namespace Quotient; static const auto basePath = QStringLiteral("/_matrix/client/r0"); -class SetRoomStateWithKeyJob::Private -{ +class SetRoomStateWithKeyJob::Private { public: QString eventId; }; -static const auto SetRoomStateWithKeyJobName = - QStringLiteral("SetRoomStateWithKeyJob"); - SetRoomStateWithKeyJob::SetRoomStateWithKeyJob(const QString& roomId, const QString& eventType, const QString& stateKey, const QJsonObject& body) - : BaseJob(HttpVerb::Put, SetRoomStateWithKeyJobName, + : BaseJob(HttpVerb::Put, QStringLiteral("SetRoomStateWithKeyJob"), basePath % "/rooms/" % roomId % "/state/" % eventType % "/" % stateKey) , d(new Private) @@ -45,17 +41,14 @@ BaseJob::Status SetRoomStateWithKeyJob::parseJson(const QJsonDocument& data) return Success; } -class SetRoomStateJob::Private -{ +class SetRoomStateJob::Private { public: QString eventId; }; -static const auto SetRoomStateJobName = QStringLiteral("SetRoomStateJob"); - SetRoomStateJob::SetRoomStateJob(const QString& roomId, const QString& eventType, const QJsonObject& body) - : BaseJob(HttpVerb::Put, SetRoomStateJobName, + : BaseJob(HttpVerb::Put, QStringLiteral("SetRoomStateJob"), basePath % "/rooms/" % roomId % "/state/" % eventType) , d(new Private) { -- 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/room_state.cpp | 53 +++--------------------------------------------- 1 file changed, 3 insertions(+), 50 deletions(-) (limited to 'lib/csapi/room_state.cpp') diff --git a/lib/csapi/room_state.cpp b/lib/csapi/room_state.cpp index 5973b06b..e18108ac 100644 --- a/lib/csapi/room_state.cpp +++ b/lib/csapi/room_state.cpp @@ -4,65 +4,18 @@ #include "room_state.h" -#include "converters.h" - #include using namespace Quotient; -static const auto basePath = QStringLiteral("/_matrix/client/r0"); - -class SetRoomStateWithKeyJob::Private { -public: - QString eventId; -}; - SetRoomStateWithKeyJob::SetRoomStateWithKeyJob(const QString& roomId, const QString& eventType, const QString& stateKey, const QJsonObject& body) : BaseJob(HttpVerb::Put, QStringLiteral("SetRoomStateWithKeyJob"), - basePath % "/rooms/" % roomId % "/state/" % eventType % "/" - % stateKey) - , d(new Private) -{ - setRequestData(Data(toJson(body))); -} - -SetRoomStateWithKeyJob::~SetRoomStateWithKeyJob() = default; - -const QString& SetRoomStateWithKeyJob::eventId() const { return d->eventId; } - -BaseJob::Status SetRoomStateWithKeyJob::parseJson(const QJsonDocument& data) -{ - auto json = data.object(); - fromJson(json.value("event_id"_ls), d->eventId); - - return Success; -} - -class SetRoomStateJob::Private { -public: - QString eventId; -}; - -SetRoomStateJob::SetRoomStateJob(const QString& roomId, const QString& eventType, - const QJsonObject& body) - : BaseJob(HttpVerb::Put, QStringLiteral("SetRoomStateJob"), - basePath % "/rooms/" % roomId % "/state/" % eventType) - , d(new Private) + QStringLiteral("/_matrix/client/r0") % "/rooms/" % roomId + % "/state/" % eventType % "/" % stateKey) { setRequestData(Data(toJson(body))); -} - -SetRoomStateJob::~SetRoomStateJob() = default; - -const QString& SetRoomStateJob::eventId() const { return d->eventId; } - -BaseJob::Status SetRoomStateJob::parseJson(const QJsonDocument& data) -{ - auto json = data.object(); - fromJson(json.value("event_id"_ls), d->eventId); - - return Success; + addExpectedKey("event_id"); } -- cgit v1.2.3