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/rooms.cpp | 122 ++++++++++++++++++++++++++++++---------------------- 1 file changed, 71 insertions(+), 51 deletions(-) (limited to 'lib/csapi/rooms.cpp') diff --git a/lib/csapi/rooms.cpp b/lib/csapi/rooms.cpp index 0b08ccec..b9de276c 100644 --- a/lib/csapi/rooms.cpp +++ b/lib/csapi/rooms.cpp @@ -15,30 +15,30 @@ static const auto basePath = QStringLiteral("/_matrix/client/r0"); class GetOneRoomEventJob::Private { public: - EventPtr data; + EventPtr data; }; -QUrl GetOneRoomEventJob::makeRequestUrl(QUrl baseUrl, const QString& roomId, const QString& eventId) +QUrl GetOneRoomEventJob::makeRequestUrl(QUrl baseUrl, const QString& roomId, + const QString& eventId) { return BaseJob::makeRequestUrl(std::move(baseUrl), - basePath % "/rooms/" % roomId % "/event/" % eventId); + basePath % "/rooms/" % roomId % "/event/" + % eventId); } static const auto GetOneRoomEventJobName = QStringLiteral("GetOneRoomEventJob"); -GetOneRoomEventJob::GetOneRoomEventJob(const QString& roomId, const QString& eventId) +GetOneRoomEventJob::GetOneRoomEventJob(const QString& roomId, + const QString& eventId) : BaseJob(HttpVerb::Get, GetOneRoomEventJobName, - basePath % "/rooms/" % roomId % "/event/" % eventId) - , d(new Private) + basePath % "/rooms/" % roomId % "/event/" % eventId), + d(new Private) { } GetOneRoomEventJob::~GetOneRoomEventJob() = default; -EventPtr&& GetOneRoomEventJob::data() -{ - return std::move(d->data); -} +EventPtr&& GetOneRoomEventJob::data() { return std::move(d->data); } BaseJob::Status GetOneRoomEventJob::parseJson(const QJsonDocument& data) { @@ -46,61 +46,69 @@ BaseJob::Status GetOneRoomEventJob::parseJson(const QJsonDocument& data) return Success; } -QUrl GetRoomStateWithKeyJob::makeRequestUrl(QUrl baseUrl, const QString& roomId, const QString& eventType, const QString& stateKey) +QUrl GetRoomStateWithKeyJob::makeRequestUrl(QUrl baseUrl, const QString& roomId, + const QString& eventType, + const QString& stateKey) { return BaseJob::makeRequestUrl(std::move(baseUrl), - basePath % "/rooms/" % roomId % "/state/" % eventType % "/" % stateKey); + basePath % "/rooms/" % roomId % "/state/" + % eventType % "/" % stateKey); } -static const auto GetRoomStateWithKeyJobName = QStringLiteral("GetRoomStateWithKeyJob"); +static const auto GetRoomStateWithKeyJobName = + QStringLiteral("GetRoomStateWithKeyJob"); -GetRoomStateWithKeyJob::GetRoomStateWithKeyJob(const QString& roomId, const QString& eventType, const QString& stateKey) +GetRoomStateWithKeyJob::GetRoomStateWithKeyJob(const QString& roomId, + const QString& eventType, + const QString& stateKey) : BaseJob(HttpVerb::Get, GetRoomStateWithKeyJobName, - basePath % "/rooms/" % roomId % "/state/" % eventType % "/" % stateKey) + basePath % "/rooms/" % roomId % "/state/" % eventType % "/" + % stateKey) { } -QUrl GetRoomStateByTypeJob::makeRequestUrl(QUrl baseUrl, const QString& roomId, const QString& eventType) +QUrl GetRoomStateByTypeJob::makeRequestUrl(QUrl baseUrl, const QString& roomId, + const QString& eventType) { return BaseJob::makeRequestUrl(std::move(baseUrl), - basePath % "/rooms/" % roomId % "/state/" % eventType); + basePath % "/rooms/" % roomId % "/state/" + % eventType); } -static const auto GetRoomStateByTypeJobName = QStringLiteral("GetRoomStateByTypeJob"); +static const auto GetRoomStateByTypeJobName = + QStringLiteral("GetRoomStateByTypeJob"); -GetRoomStateByTypeJob::GetRoomStateByTypeJob(const QString& roomId, const QString& eventType) +GetRoomStateByTypeJob::GetRoomStateByTypeJob(const QString& roomId, + const QString& eventType) : BaseJob(HttpVerb::Get, GetRoomStateByTypeJobName, - basePath % "/rooms/" % roomId % "/state/" % eventType) + basePath % "/rooms/" % roomId % "/state/" % eventType) { } class GetRoomStateJob::Private { public: - StateEvents data; + StateEvents data; }; QUrl GetRoomStateJob::makeRequestUrl(QUrl baseUrl, const QString& roomId) { return BaseJob::makeRequestUrl(std::move(baseUrl), - basePath % "/rooms/" % roomId % "/state"); + basePath % "/rooms/" % roomId % "/state"); } static const auto GetRoomStateJobName = QStringLiteral("GetRoomStateJob"); GetRoomStateJob::GetRoomStateJob(const QString& roomId) : BaseJob(HttpVerb::Get, GetRoomStateJobName, - basePath % "/rooms/" % roomId % "/state") - , d(new Private) + basePath % "/rooms/" % roomId % "/state"), + d(new Private) { } GetRoomStateJob::~GetRoomStateJob() = default; -StateEvents&& GetRoomStateJob::data() -{ - return std::move(d->data); -} +StateEvents&& GetRoomStateJob::data() { return std::move(d->data); } BaseJob::Status GetRoomStateJob::parseJson(const QJsonDocument& data) { @@ -111,10 +119,12 @@ BaseJob::Status GetRoomStateJob::parseJson(const QJsonDocument& data) class GetMembersByRoomJob::Private { public: - EventsArray chunk; + EventsArray chunk; }; -BaseJob::Query queryToGetMembersByRoom(const QString& at, const QString& membership, const QString& notMembership) +BaseJob::Query queryToGetMembersByRoom(const QString& at, + const QString& membership, + const QString& notMembership) { BaseJob::Query _q; addParam(_q, QStringLiteral("at"), at); @@ -123,20 +133,27 @@ BaseJob::Query queryToGetMembersByRoom(const QString& at, const QString& members return _q; } -QUrl GetMembersByRoomJob::makeRequestUrl(QUrl baseUrl, const QString& roomId, const QString& at, const QString& membership, const QString& notMembership) +QUrl GetMembersByRoomJob::makeRequestUrl(QUrl baseUrl, const QString& roomId, + const QString& at, + const QString& membership, + const QString& notMembership) { - return BaseJob::makeRequestUrl(std::move(baseUrl), - basePath % "/rooms/" % roomId % "/members", + return BaseJob::makeRequestUrl( + std::move(baseUrl), basePath % "/rooms/" % roomId % "/members", queryToGetMembersByRoom(at, membership, notMembership)); } -static const auto GetMembersByRoomJobName = QStringLiteral("GetMembersByRoomJob"); +static const auto GetMembersByRoomJobName = + QStringLiteral("GetMembersByRoomJob"); -GetMembersByRoomJob::GetMembersByRoomJob(const QString& roomId, const QString& at, const QString& membership, const QString& notMembership) +GetMembersByRoomJob::GetMembersByRoomJob(const QString& roomId, + const QString& at, + const QString& membership, + const QString& notMembership) : BaseJob(HttpVerb::Get, GetMembersByRoomJobName, - basePath % "/rooms/" % roomId % "/members", - queryToGetMembersByRoom(at, membership, notMembership)) - , d(new Private) + basePath % "/rooms/" % roomId % "/members", + queryToGetMembersByRoom(at, membership, notMembership)), + d(new Private) { } @@ -154,13 +171,13 @@ BaseJob::Status GetMembersByRoomJob::parseJson(const QJsonDocument& data) return Success; } -namespace QMatrixClient -{ +namespace QMatrixClient { // Converters - template <> struct JsonObjectConverter - { - static void fillFrom(const QJsonObject& jo, GetJoinedMembersByRoomJob::RoomMember& result) + template <> + struct JsonObjectConverter { + static void fillFrom(const QJsonObject& jo, + GetJoinedMembersByRoomJob::RoomMember& result) { fromJson(jo.value("display_name"_ls), result.displayName); fromJson(jo.value("avatar_url"_ls), result.avatarUrl); @@ -171,27 +188,31 @@ namespace QMatrixClient class GetJoinedMembersByRoomJob::Private { public: - QHash joined; + QHash joined; }; -QUrl GetJoinedMembersByRoomJob::makeRequestUrl(QUrl baseUrl, const QString& roomId) +QUrl GetJoinedMembersByRoomJob::makeRequestUrl(QUrl baseUrl, + const QString& roomId) { return BaseJob::makeRequestUrl(std::move(baseUrl), - basePath % "/rooms/" % roomId % "/joined_members"); + basePath % "/rooms/" % roomId + % "/joined_members"); } -static const auto GetJoinedMembersByRoomJobName = QStringLiteral("GetJoinedMembersByRoomJob"); +static const auto GetJoinedMembersByRoomJobName = + QStringLiteral("GetJoinedMembersByRoomJob"); GetJoinedMembersByRoomJob::GetJoinedMembersByRoomJob(const QString& roomId) : BaseJob(HttpVerb::Get, GetJoinedMembersByRoomJobName, - basePath % "/rooms/" % roomId % "/joined_members") - , d(new Private) + basePath % "/rooms/" % roomId % "/joined_members"), + d(new Private) { } GetJoinedMembersByRoomJob::~GetJoinedMembersByRoomJob() = default; -const QHash& GetJoinedMembersByRoomJob::joined() const +const QHash& +GetJoinedMembersByRoomJob::joined() const { return d->joined; } @@ -202,4 +223,3 @@ BaseJob::Status GetJoinedMembersByRoomJob::parseJson(const QJsonDocument& data) fromJson(json.value("joined"_ls), d->joined); 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/rooms.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/csapi/rooms.cpp') diff --git a/lib/csapi/rooms.cpp b/lib/csapi/rooms.cpp index 280e8d59..5bfbe44d 100644 --- a/lib/csapi/rooms.cpp +++ b/lib/csapi/rooms.cpp @@ -8,7 +8,7 @@ #include -using namespace QMatrixClient; +using namespace Quotient; static const auto basePath = QStringLiteral("/_matrix/client/r0"); @@ -168,7 +168,7 @@ BaseJob::Status GetMembersByRoomJob::parseJson(const QJsonDocument& data) } // Converters -namespace QMatrixClient +namespace Quotient { template <> @@ -182,7 +182,7 @@ struct JsonObjectConverter } }; -} // namespace QMatrixClient +} // namespace Quotient class GetJoinedMembersByRoomJob::Private { -- 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/rooms.cpp | 60 +++++++++++++++++++---------------------------------- 1 file changed, 21 insertions(+), 39 deletions(-) (limited to 'lib/csapi/rooms.cpp') diff --git a/lib/csapi/rooms.cpp b/lib/csapi/rooms.cpp index 5bfbe44d..234e33df 100644 --- a/lib/csapi/rooms.cpp +++ b/lib/csapi/rooms.cpp @@ -12,8 +12,7 @@ using namespace Quotient; static const auto basePath = QStringLiteral("/_matrix/client/r0"); -class GetOneRoomEventJob::Private -{ +class GetOneRoomEventJob::Private { public: EventPtr data; }; @@ -26,11 +25,9 @@ QUrl GetOneRoomEventJob::makeRequestUrl(QUrl baseUrl, const QString& roomId, % eventId); } -static const auto GetOneRoomEventJobName = QStringLiteral("GetOneRoomEventJob"); - GetOneRoomEventJob::GetOneRoomEventJob(const QString& roomId, const QString& eventId) - : BaseJob(HttpVerb::Get, GetOneRoomEventJobName, + : BaseJob(HttpVerb::Get, QStringLiteral("GetOneRoomEventJob"), basePath % "/rooms/" % roomId % "/event/" % eventId) , d(new Private) {} @@ -42,6 +39,7 @@ EventPtr&& GetOneRoomEventJob::data() { return std::move(d->data); } BaseJob::Status GetOneRoomEventJob::parseJson(const QJsonDocument& data) { fromJson(data, d->data); + return Success; } @@ -54,13 +52,10 @@ QUrl GetRoomStateWithKeyJob::makeRequestUrl(QUrl baseUrl, const QString& roomId, % eventType % "/" % stateKey); } -static const auto GetRoomStateWithKeyJobName = - QStringLiteral("GetRoomStateWithKeyJob"); - GetRoomStateWithKeyJob::GetRoomStateWithKeyJob(const QString& roomId, const QString& eventType, const QString& stateKey) - : BaseJob(HttpVerb::Get, GetRoomStateWithKeyJobName, + : BaseJob(HttpVerb::Get, QStringLiteral("GetRoomStateWithKeyJob"), basePath % "/rooms/" % roomId % "/state/" % eventType % "/" % stateKey) {} @@ -73,17 +68,13 @@ QUrl GetRoomStateByTypeJob::makeRequestUrl(QUrl baseUrl, const QString& roomId, % eventType); } -static const auto GetRoomStateByTypeJobName = - QStringLiteral("GetRoomStateByTypeJob"); - GetRoomStateByTypeJob::GetRoomStateByTypeJob(const QString& roomId, const QString& eventType) - : BaseJob(HttpVerb::Get, GetRoomStateByTypeJobName, + : BaseJob(HttpVerb::Get, QStringLiteral("GetRoomStateByTypeJob"), basePath % "/rooms/" % roomId % "/state/" % eventType) {} -class GetRoomStateJob::Private -{ +class GetRoomStateJob::Private { public: StateEvents data; }; @@ -94,10 +85,8 @@ QUrl GetRoomStateJob::makeRequestUrl(QUrl baseUrl, const QString& roomId) basePath % "/rooms/" % roomId % "/state"); } -static const auto GetRoomStateJobName = QStringLiteral("GetRoomStateJob"); - GetRoomStateJob::GetRoomStateJob(const QString& roomId) - : BaseJob(HttpVerb::Get, GetRoomStateJobName, + : BaseJob(HttpVerb::Get, QStringLiteral("GetRoomStateJob"), basePath % "/rooms/" % roomId % "/state") , d(new Private) {} @@ -109,11 +98,11 @@ StateEvents&& GetRoomStateJob::data() { return std::move(d->data); } BaseJob::Status GetRoomStateJob::parseJson(const QJsonDocument& data) { fromJson(data, d->data); + return Success; } -class GetMembersByRoomJob::Private -{ +class GetMembersByRoomJob::Private { public: EventsArray chunk; }; @@ -134,19 +123,17 @@ QUrl GetMembersByRoomJob::makeRequestUrl(QUrl baseUrl, const QString& roomId, const QString& membership, const QString& notMembership) { - return BaseJob::makeRequestUrl( - std::move(baseUrl), basePath % "/rooms/" % roomId % "/members", - queryToGetMembersByRoom(at, membership, notMembership)); + return BaseJob::makeRequestUrl(std::move(baseUrl), + basePath % "/rooms/" % roomId % "/members", + queryToGetMembersByRoom(at, membership, + notMembership)); } -static const auto GetMembersByRoomJobName = - QStringLiteral("GetMembersByRoomJob"); - GetMembersByRoomJob::GetMembersByRoomJob(const QString& roomId, const QString& at, const QString& membership, const QString& notMembership) - : BaseJob(HttpVerb::Get, GetMembersByRoomJobName, + : BaseJob(HttpVerb::Get, QStringLiteral("GetMembersByRoomJob"), basePath % "/rooms/" % roomId % "/members", queryToGetMembersByRoom(at, membership, notMembership)) , d(new Private) @@ -168,12 +155,10 @@ BaseJob::Status GetMembersByRoomJob::parseJson(const QJsonDocument& data) } // Converters -namespace Quotient -{ +namespace Quotient { template <> -struct JsonObjectConverter -{ +struct JsonObjectConverter { static void fillFrom(const QJsonObject& jo, GetJoinedMembersByRoomJob::RoomMember& result) { @@ -184,8 +169,7 @@ struct JsonObjectConverter } // namespace Quotient -class GetJoinedMembersByRoomJob::Private -{ +class GetJoinedMembersByRoomJob::Private { public: QHash joined; }; @@ -193,15 +177,13 @@ public: QUrl GetJoinedMembersByRoomJob::makeRequestUrl(QUrl baseUrl, const QString& roomId) { - return BaseJob::makeRequestUrl( - std::move(baseUrl), basePath % "/rooms/" % roomId % "/joined_members"); + return BaseJob::makeRequestUrl(std::move(baseUrl), basePath % "/rooms/" + % roomId + % "/joined_members"); } -static const auto GetJoinedMembersByRoomJobName = - QStringLiteral("GetJoinedMembersByRoomJob"); - GetJoinedMembersByRoomJob::GetJoinedMembersByRoomJob(const QString& roomId) - : BaseJob(HttpVerb::Get, GetJoinedMembersByRoomJobName, + : BaseJob(HttpVerb::Get, QStringLiteral("GetJoinedMembersByRoomJob"), basePath % "/rooms/" % roomId % "/joined_members") , 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/rooms.cpp | 158 +++++++++------------------------------------------- 1 file changed, 27 insertions(+), 131 deletions(-) (limited to 'lib/csapi/rooms.cpp') diff --git a/lib/csapi/rooms.cpp b/lib/csapi/rooms.cpp index 234e33df..724d941f 100644 --- a/lib/csapi/rooms.cpp +++ b/lib/csapi/rooms.cpp @@ -4,51 +4,33 @@ #include "rooms.h" -#include "converters.h" - #include using namespace Quotient; -static const auto basePath = QStringLiteral("/_matrix/client/r0"); - -class GetOneRoomEventJob::Private { -public: - EventPtr data; -}; - QUrl GetOneRoomEventJob::makeRequestUrl(QUrl baseUrl, const QString& roomId, const QString& eventId) { - return BaseJob::makeRequestUrl(std::move(baseUrl), basePath % "/rooms/" - % roomId % "/event/" - % eventId); + return BaseJob::makeRequestUrl(std::move(baseUrl), + QStringLiteral("/_matrix/client/r0") + % "/rooms/" % roomId % "/event/" + % eventId); } GetOneRoomEventJob::GetOneRoomEventJob(const QString& roomId, const QString& eventId) : BaseJob(HttpVerb::Get, QStringLiteral("GetOneRoomEventJob"), - basePath % "/rooms/" % roomId % "/event/" % eventId) - , d(new Private) + QStringLiteral("/_matrix/client/r0") % "/rooms/" % roomId + % "/event/" % eventId) {} -GetOneRoomEventJob::~GetOneRoomEventJob() = default; - -EventPtr&& GetOneRoomEventJob::data() { return std::move(d->data); } - -BaseJob::Status GetOneRoomEventJob::parseJson(const QJsonDocument& data) -{ - fromJson(data, d->data); - - return Success; -} - QUrl GetRoomStateWithKeyJob::makeRequestUrl(QUrl baseUrl, const QString& roomId, const QString& eventType, const QString& stateKey) { return BaseJob::makeRequestUrl(std::move(baseUrl), - basePath % "/rooms/" % roomId % "/state/" + QStringLiteral("/_matrix/client/r0") + % "/rooms/" % roomId % "/state/" % eventType % "/" % stateKey); } @@ -56,60 +38,25 @@ GetRoomStateWithKeyJob::GetRoomStateWithKeyJob(const QString& roomId, const QString& eventType, const QString& stateKey) : BaseJob(HttpVerb::Get, QStringLiteral("GetRoomStateWithKeyJob"), - basePath % "/rooms/" % roomId % "/state/" % eventType % "/" - % stateKey) + QStringLiteral("/_matrix/client/r0") % "/rooms/" % roomId + % "/state/" % eventType % "/" % stateKey) {} -QUrl GetRoomStateByTypeJob::makeRequestUrl(QUrl baseUrl, const QString& roomId, - const QString& eventType) -{ - return BaseJob::makeRequestUrl(std::move(baseUrl), basePath % "/rooms/" - % roomId % "/state/" - % eventType); -} - -GetRoomStateByTypeJob::GetRoomStateByTypeJob(const QString& roomId, - const QString& eventType) - : BaseJob(HttpVerb::Get, QStringLiteral("GetRoomStateByTypeJob"), - basePath % "/rooms/" % roomId % "/state/" % eventType) -{} - -class GetRoomStateJob::Private { -public: - StateEvents data; -}; - QUrl GetRoomStateJob::makeRequestUrl(QUrl baseUrl, const QString& roomId) { return BaseJob::makeRequestUrl(std::move(baseUrl), - basePath % "/rooms/" % roomId % "/state"); + QStringLiteral("/_matrix/client/r0") + % "/rooms/" % roomId % "/state"); } GetRoomStateJob::GetRoomStateJob(const QString& roomId) : BaseJob(HttpVerb::Get, QStringLiteral("GetRoomStateJob"), - basePath % "/rooms/" % roomId % "/state") - , d(new Private) + QStringLiteral("/_matrix/client/r0") % "/rooms/" % roomId + % "/state") {} -GetRoomStateJob::~GetRoomStateJob() = default; - -StateEvents&& GetRoomStateJob::data() { return std::move(d->data); } - -BaseJob::Status GetRoomStateJob::parseJson(const QJsonDocument& data) -{ - fromJson(data, d->data); - - return Success; -} - -class GetMembersByRoomJob::Private { -public: - EventsArray chunk; -}; - -BaseJob::Query queryToGetMembersByRoom(const QString& at, - const QString& membership, - const QString& notMembership) +auto queryToGetMembersByRoom(const QString& at, const QString& membership, + const QString& notMembership) { BaseJob::Query _q; addParam(_q, QStringLiteral("at"), at); @@ -123,10 +70,10 @@ QUrl GetMembersByRoomJob::makeRequestUrl(QUrl baseUrl, const QString& roomId, const QString& membership, const QString& notMembership) { - return BaseJob::makeRequestUrl(std::move(baseUrl), - basePath % "/rooms/" % roomId % "/members", - queryToGetMembersByRoom(at, membership, - notMembership)); + return BaseJob::makeRequestUrl( + std::move(baseUrl), + QStringLiteral("/_matrix/client/r0") % "/rooms/" % roomId % "/members", + queryToGetMembersByRoom(at, membership, notMembership)); } GetMembersByRoomJob::GetMembersByRoomJob(const QString& roomId, @@ -134,72 +81,21 @@ GetMembersByRoomJob::GetMembersByRoomJob(const QString& roomId, const QString& membership, const QString& notMembership) : BaseJob(HttpVerb::Get, QStringLiteral("GetMembersByRoomJob"), - basePath % "/rooms/" % roomId % "/members", + QStringLiteral("/_matrix/client/r0") % "/rooms/" % roomId + % "/members", queryToGetMembersByRoom(at, membership, notMembership)) - , d(new Private) {} -GetMembersByRoomJob::~GetMembersByRoomJob() = default; - -EventsArray&& GetMembersByRoomJob::chunk() -{ - return std::move(d->chunk); -} - -BaseJob::Status GetMembersByRoomJob::parseJson(const QJsonDocument& data) -{ - auto json = data.object(); - fromJson(json.value("chunk"_ls), d->chunk); - - return Success; -} - -// Converters -namespace Quotient { - -template <> -struct JsonObjectConverter { - static void fillFrom(const QJsonObject& jo, - GetJoinedMembersByRoomJob::RoomMember& result) - { - fromJson(jo.value("display_name"_ls), result.displayName); - fromJson(jo.value("avatar_url"_ls), result.avatarUrl); - } -}; - -} // namespace Quotient - -class GetJoinedMembersByRoomJob::Private { -public: - QHash joined; -}; - QUrl GetJoinedMembersByRoomJob::makeRequestUrl(QUrl baseUrl, const QString& roomId) { - return BaseJob::makeRequestUrl(std::move(baseUrl), basePath % "/rooms/" - % roomId - % "/joined_members"); + return BaseJob::makeRequestUrl(std::move(baseUrl), + QStringLiteral("/_matrix/client/r0") + % "/rooms/" % roomId % "/joined_members"); } GetJoinedMembersByRoomJob::GetJoinedMembersByRoomJob(const QString& roomId) : BaseJob(HttpVerb::Get, QStringLiteral("GetJoinedMembersByRoomJob"), - basePath % "/rooms/" % roomId % "/joined_members") - , d(new Private) + QStringLiteral("/_matrix/client/r0") % "/rooms/" % roomId + % "/joined_members") {} - -GetJoinedMembersByRoomJob::~GetJoinedMembersByRoomJob() = default; - -const QHash& -GetJoinedMembersByRoomJob::joined() const -{ - return d->joined; -} - -BaseJob::Status GetJoinedMembersByRoomJob::parseJson(const QJsonDocument& data) -{ - auto json = data.object(); - fromJson(json.value("joined"_ls), d->joined); - - return Success; -} -- cgit v1.2.3