From d9ff200ff62fb7f5b6b51082dc3979d5454a1bec Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Sat, 25 Aug 2018 22:40:15 +0900 Subject: Update to the recent CS API (watch out for breakage) Breaking changes: * guest_can_join is no more a thing - neither in Connection::createRoom, nor even in CreateRoomJob (it turned out that Synapse didn't really process this flag); * LoginJob has changed its list of arguments. If you use Connection to do logins (and you really should), you shouldn't be affected. * GetPublicRoomsJob now returns PublicRoomsResponse instead of providing all the response parts within the job Watch other changes in the diff. --- lib/csapi/third_party_lookup.cpp | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) (limited to 'lib/csapi/third_party_lookup.cpp') diff --git a/lib/csapi/third_party_lookup.cpp b/lib/csapi/third_party_lookup.cpp index 45ccb7c3..406e6d34 100644 --- a/lib/csapi/third_party_lookup.cpp +++ b/lib/csapi/third_party_lookup.cpp @@ -28,7 +28,7 @@ static const auto GetProtocolsJobName = QStringLiteral("GetProtocolsJob"); GetProtocolsJob::GetProtocolsJob() : BaseJob(HttpVerb::Get, GetProtocolsJobName, - basePath % "/thirdparty/protocols", false) + basePath % "/thirdparty/protocols") , d(new Private) { } @@ -66,7 +66,7 @@ static const auto GetProtocolMetadataJobName = QStringLiteral("GetProtocolMetada GetProtocolMetadataJob::GetProtocolMetadataJob(const QString& protocol) : BaseJob(HttpVerb::Get, GetProtocolMetadataJobName, - basePath % "/thirdparty/protocol/" % protocol, false) + basePath % "/thirdparty/protocol/" % protocol) , d(new Private) { } @@ -113,8 +113,7 @@ static const auto QueryLocationByProtocolJobName = QStringLiteral("QueryLocation QueryLocationByProtocolJob::QueryLocationByProtocolJob(const QString& protocol, const QString& searchFields) : BaseJob(HttpVerb::Get, QueryLocationByProtocolJobName, basePath % "/thirdparty/location/" % protocol, - queryToQueryLocationByProtocol(searchFields), - {}, false) + queryToQueryLocationByProtocol(searchFields)) , d(new Private) { } @@ -142,14 +141,14 @@ class QueryUserByProtocolJob::Private QVector data; }; -BaseJob::Query queryToQueryUserByProtocol(const QJsonObject& fields) +BaseJob::Query queryToQueryUserByProtocol(const QString& fields) { BaseJob::Query _q; - addParam(_q, QStringLiteral("fields"), fields); + addParam(_q, QStringLiteral("fields..."), fields); return _q; } -QUrl QueryUserByProtocolJob::makeRequestUrl(QUrl baseUrl, const QString& protocol, const QJsonObject& fields) +QUrl QueryUserByProtocolJob::makeRequestUrl(QUrl baseUrl, const QString& protocol, const QString& fields) { return BaseJob::makeRequestUrl(std::move(baseUrl), basePath % "/thirdparty/user/" % protocol, @@ -158,11 +157,10 @@ QUrl QueryUserByProtocolJob::makeRequestUrl(QUrl baseUrl, const QString& protoco static const auto QueryUserByProtocolJobName = QStringLiteral("QueryUserByProtocolJob"); -QueryUserByProtocolJob::QueryUserByProtocolJob(const QString& protocol, const QJsonObject& fields) +QueryUserByProtocolJob::QueryUserByProtocolJob(const QString& protocol, const QString& fields) : BaseJob(HttpVerb::Get, QueryUserByProtocolJobName, basePath % "/thirdparty/user/" % protocol, - queryToQueryUserByProtocol(fields), - {}, false) + queryToQueryUserByProtocol(fields)) , d(new Private) { } @@ -209,8 +207,7 @@ static const auto QueryLocationByAliasJobName = QStringLiteral("QueryLocationByA QueryLocationByAliasJob::QueryLocationByAliasJob(const QString& alias) : BaseJob(HttpVerb::Get, QueryLocationByAliasJobName, basePath % "/thirdparty/location", - queryToQueryLocationByAlias(alias), - {}, false) + queryToQueryLocationByAlias(alias)) , d(new Private) { } @@ -257,8 +254,7 @@ static const auto QueryUserByIDJobName = QStringLiteral("QueryUserByIDJob"); QueryUserByIDJob::QueryUserByIDJob(const QString& userid) : BaseJob(HttpVerb::Get, QueryUserByIDJobName, basePath % "/thirdparty/user", - queryToQueryUserByID(userid), - {}, false) + queryToQueryUserByID(userid)) , d(new Private) { } -- cgit v1.2.3