diff options
Diffstat (limited to 'lib/csapi/third_party_lookup.cpp')
-rw-r--r-- | lib/csapi/third_party_lookup.cpp | 95 |
1 files changed, 52 insertions, 43 deletions
diff --git a/lib/csapi/third_party_lookup.cpp b/lib/csapi/third_party_lookup.cpp index 12cb7c59..339a0d90 100644 --- a/lib/csapi/third_party_lookup.cpp +++ b/lib/csapi/third_party_lookup.cpp @@ -15,21 +15,21 @@ static const auto basePath = QStringLiteral("/_matrix/client/r0"); class GetProtocolsJob::Private { public: - QHash<QString, ThirdPartyProtocol> data; + QHash<QString, ThirdPartyProtocol> data; }; QUrl GetProtocolsJob::makeRequestUrl(QUrl baseUrl) { return BaseJob::makeRequestUrl(std::move(baseUrl), - basePath % "/thirdparty/protocols"); + basePath % "/thirdparty/protocols"); } static const auto GetProtocolsJobName = QStringLiteral("GetProtocolsJob"); GetProtocolsJob::GetProtocolsJob() : BaseJob(HttpVerb::Get, GetProtocolsJobName, - basePath % "/thirdparty/protocols") - , d(new Private) + basePath % "/thirdparty/protocols"), + d(new Private) { } @@ -49,21 +49,23 @@ BaseJob::Status GetProtocolsJob::parseJson(const QJsonDocument& data) class GetProtocolMetadataJob::Private { public: - ThirdPartyProtocol data; + ThirdPartyProtocol data; }; -QUrl GetProtocolMetadataJob::makeRequestUrl(QUrl baseUrl, const QString& protocol) +QUrl GetProtocolMetadataJob::makeRequestUrl(QUrl baseUrl, + const QString& protocol) { - return BaseJob::makeRequestUrl(std::move(baseUrl), - basePath % "/thirdparty/protocol/" % protocol); + return BaseJob::makeRequestUrl( + std::move(baseUrl), basePath % "/thirdparty/protocol/" % protocol); } -static const auto GetProtocolMetadataJobName = QStringLiteral("GetProtocolMetadataJob"); +static const auto GetProtocolMetadataJobName = + QStringLiteral("GetProtocolMetadataJob"); GetProtocolMetadataJob::GetProtocolMetadataJob(const QString& protocol) : BaseJob(HttpVerb::Get, GetProtocolMetadataJobName, - basePath % "/thirdparty/protocol/" % protocol) - , d(new Private) + basePath % "/thirdparty/protocol/" % protocol), + d(new Private) { } @@ -83,7 +85,7 @@ BaseJob::Status GetProtocolMetadataJob::parseJson(const QJsonDocument& data) class QueryLocationByProtocolJob::Private { public: - QVector<ThirdPartyLocation> data; + QVector<ThirdPartyLocation> data; }; BaseJob::Query queryToQueryLocationByProtocol(const QString& searchFields) @@ -93,20 +95,24 @@ BaseJob::Query queryToQueryLocationByProtocol(const QString& searchFields) return _q; } -QUrl QueryLocationByProtocolJob::makeRequestUrl(QUrl baseUrl, const QString& protocol, const QString& searchFields) +QUrl QueryLocationByProtocolJob::makeRequestUrl(QUrl baseUrl, + const QString& protocol, + const QString& searchFields) { - return BaseJob::makeRequestUrl(std::move(baseUrl), - basePath % "/thirdparty/location/" % protocol, + return BaseJob::makeRequestUrl( + std::move(baseUrl), basePath % "/thirdparty/location/" % protocol, queryToQueryLocationByProtocol(searchFields)); } -static const auto QueryLocationByProtocolJobName = QStringLiteral("QueryLocationByProtocolJob"); +static const auto QueryLocationByProtocolJobName = + QStringLiteral("QueryLocationByProtocolJob"); -QueryLocationByProtocolJob::QueryLocationByProtocolJob(const QString& protocol, const QString& searchFields) +QueryLocationByProtocolJob::QueryLocationByProtocolJob( + const QString& protocol, const QString& searchFields) : BaseJob(HttpVerb::Get, QueryLocationByProtocolJobName, - basePath % "/thirdparty/location/" % protocol, - queryToQueryLocationByProtocol(searchFields)) - , d(new Private) + basePath % "/thirdparty/location/" % protocol, + queryToQueryLocationByProtocol(searchFields)), + d(new Private) { } @@ -126,7 +132,7 @@ BaseJob::Status QueryLocationByProtocolJob::parseJson(const QJsonDocument& data) class QueryUserByProtocolJob::Private { public: - QVector<ThirdPartyUser> data; + QVector<ThirdPartyUser> data; }; BaseJob::Query queryToQueryUserByProtocol(const QString& fields) @@ -136,20 +142,24 @@ BaseJob::Query queryToQueryUserByProtocol(const QString& fields) return _q; } -QUrl QueryUserByProtocolJob::makeRequestUrl(QUrl baseUrl, const QString& protocol, const QString& fields) +QUrl QueryUserByProtocolJob::makeRequestUrl(QUrl baseUrl, + const QString& protocol, + const QString& fields) { return BaseJob::makeRequestUrl(std::move(baseUrl), - basePath % "/thirdparty/user/" % protocol, - queryToQueryUserByProtocol(fields)); + basePath % "/thirdparty/user/" % protocol, + queryToQueryUserByProtocol(fields)); } -static const auto QueryUserByProtocolJobName = QStringLiteral("QueryUserByProtocolJob"); +static const auto QueryUserByProtocolJobName = + QStringLiteral("QueryUserByProtocolJob"); -QueryUserByProtocolJob::QueryUserByProtocolJob(const QString& protocol, const QString& fields) +QueryUserByProtocolJob::QueryUserByProtocolJob(const QString& protocol, + const QString& fields) : BaseJob(HttpVerb::Get, QueryUserByProtocolJobName, - basePath % "/thirdparty/user/" % protocol, - queryToQueryUserByProtocol(fields)) - , d(new Private) + basePath % "/thirdparty/user/" % protocol, + queryToQueryUserByProtocol(fields)), + d(new Private) { } @@ -169,7 +179,7 @@ BaseJob::Status QueryUserByProtocolJob::parseJson(const QJsonDocument& data) class QueryLocationByAliasJob::Private { public: - QVector<ThirdPartyLocation> data; + QVector<ThirdPartyLocation> data; }; BaseJob::Query queryToQueryLocationByAlias(const QString& alias) @@ -182,17 +192,18 @@ BaseJob::Query queryToQueryLocationByAlias(const QString& alias) QUrl QueryLocationByAliasJob::makeRequestUrl(QUrl baseUrl, const QString& alias) { return BaseJob::makeRequestUrl(std::move(baseUrl), - basePath % "/thirdparty/location", - queryToQueryLocationByAlias(alias)); + basePath % "/thirdparty/location", + queryToQueryLocationByAlias(alias)); } -static const auto QueryLocationByAliasJobName = QStringLiteral("QueryLocationByAliasJob"); +static const auto QueryLocationByAliasJobName = + QStringLiteral("QueryLocationByAliasJob"); QueryLocationByAliasJob::QueryLocationByAliasJob(const QString& alias) : BaseJob(HttpVerb::Get, QueryLocationByAliasJobName, - basePath % "/thirdparty/location", - queryToQueryLocationByAlias(alias)) - , d(new Private) + basePath % "/thirdparty/location", + queryToQueryLocationByAlias(alias)), + d(new Private) { } @@ -212,7 +223,7 @@ BaseJob::Status QueryLocationByAliasJob::parseJson(const QJsonDocument& data) class QueryUserByIDJob::Private { public: - QVector<ThirdPartyUser> data; + QVector<ThirdPartyUser> data; }; BaseJob::Query queryToQueryUserByID(const QString& userid) @@ -225,17 +236,16 @@ BaseJob::Query queryToQueryUserByID(const QString& userid) QUrl QueryUserByIDJob::makeRequestUrl(QUrl baseUrl, const QString& userid) { return BaseJob::makeRequestUrl(std::move(baseUrl), - basePath % "/thirdparty/user", - queryToQueryUserByID(userid)); + basePath % "/thirdparty/user", + queryToQueryUserByID(userid)); } static const auto QueryUserByIDJobName = QStringLiteral("QueryUserByIDJob"); QueryUserByIDJob::QueryUserByIDJob(const QString& userid) : BaseJob(HttpVerb::Get, QueryUserByIDJobName, - basePath % "/thirdparty/user", - queryToQueryUserByID(userid)) - , d(new Private) + basePath % "/thirdparty/user", queryToQueryUserByID(userid)), + d(new Private) { } @@ -251,4 +261,3 @@ BaseJob::Status QueryUserByIDJob::parseJson(const QJsonDocument& data) fromJson(data, d->data); return Success; } - |