From 42811660094c88a4a1bfa8bd8ace5f4b148c246a Mon Sep 17 00:00:00 2001 From: Alexey Rusakov Date: Tue, 31 May 2022 18:24:53 +0200 Subject: Regenerate API files (FTBFS; see the next commit) --- lib/csapi/registration.cpp | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'lib/csapi/registration.cpp') diff --git a/lib/csapi/registration.cpp b/lib/csapi/registration.cpp index 153abcee..aa4b4fad 100644 --- a/lib/csapi/registration.cpp +++ b/lib/csapi/registration.cpp @@ -20,7 +20,7 @@ RegisterJob::RegisterJob(const QString& kind, const QString& initialDeviceDisplayName, Omittable inhibitLogin) : BaseJob(HttpVerb::Post, QStringLiteral("RegisterJob"), - makePath("/_matrix/client/r0", "/register"), + makePath("/_matrix/client/v3", "/register"), queryToRegister(kind), {}, false) { QJsonObject _data; @@ -38,7 +38,7 @@ RegisterJob::RegisterJob(const QString& kind, RequestTokenToRegisterEmailJob::RequestTokenToRegisterEmailJob( const EmailValidationData& body) : BaseJob(HttpVerb::Post, QStringLiteral("RequestTokenToRegisterEmailJob"), - makePath("/_matrix/client/r0", "/register/email/requestToken"), + makePath("/_matrix/client/v3", "/register/email/requestToken"), false) { setRequestData(RequestData(toJson(body))); @@ -47,7 +47,7 @@ RequestTokenToRegisterEmailJob::RequestTokenToRegisterEmailJob( RequestTokenToRegisterMSISDNJob::RequestTokenToRegisterMSISDNJob( const MsisdnValidationData& body) : BaseJob(HttpVerb::Post, QStringLiteral("RequestTokenToRegisterMSISDNJob"), - makePath("/_matrix/client/r0", "/register/msisdn/requestToken"), + makePath("/_matrix/client/v3", "/register/msisdn/requestToken"), false) { setRequestData(RequestData(toJson(body))); @@ -57,7 +57,7 @@ ChangePasswordJob::ChangePasswordJob(const QString& newPassword, bool logoutDevices, const Omittable& auth) : BaseJob(HttpVerb::Post, QStringLiteral("ChangePasswordJob"), - makePath("/_matrix/client/r0", "/account/password")) + makePath("/_matrix/client/v3", "/account/password")) { QJsonObject _data; addParam<>(_data, QStringLiteral("new_password"), newPassword); @@ -70,7 +70,7 @@ RequestTokenToResetPasswordEmailJob::RequestTokenToResetPasswordEmailJob( const EmailValidationData& body) : BaseJob(HttpVerb::Post, QStringLiteral("RequestTokenToResetPasswordEmailJob"), - makePath("/_matrix/client/r0", + makePath("/_matrix/client/v3", "/account/password/email/requestToken"), false) { @@ -81,7 +81,7 @@ RequestTokenToResetPasswordMSISDNJob::RequestTokenToResetPasswordMSISDNJob( const MsisdnValidationData& body) : BaseJob(HttpVerb::Post, QStringLiteral("RequestTokenToResetPasswordMSISDNJob"), - makePath("/_matrix/client/r0", + makePath("/_matrix/client/v3", "/account/password/msisdn/requestToken"), false) { @@ -91,7 +91,7 @@ RequestTokenToResetPasswordMSISDNJob::RequestTokenToResetPasswordMSISDNJob( DeactivateAccountJob::DeactivateAccountJob( const Omittable& auth, const QString& idServer) : BaseJob(HttpVerb::Post, QStringLiteral("DeactivateAccountJob"), - makePath("/_matrix/client/r0", "/account/deactivate")) + makePath("/_matrix/client/v3", "/account/deactivate")) { QJsonObject _data; addParam(_data, QStringLiteral("auth"), auth); @@ -111,13 +111,14 @@ QUrl CheckUsernameAvailabilityJob::makeRequestUrl(QUrl baseUrl, const QString& username) { return BaseJob::makeRequestUrl(std::move(baseUrl), - makePath("/_matrix/client/r0", + makePath("/_matrix/client/v3", "/register/available"), queryToCheckUsernameAvailability(username)); } -CheckUsernameAvailabilityJob::CheckUsernameAvailabilityJob(const QString& username) +CheckUsernameAvailabilityJob::CheckUsernameAvailabilityJob( + const QString& username) : BaseJob(HttpVerb::Get, QStringLiteral("CheckUsernameAvailabilityJob"), - makePath("/_matrix/client/r0", "/register/available"), + makePath("/_matrix/client/v3", "/register/available"), queryToCheckUsernameAvailability(username), {}, false) {} -- cgit v1.2.3 From ed05d9d589fe3d36bd3714e648016352179afbef Mon Sep 17 00:00:00 2001 From: Alexey Rusakov Date: Sat, 11 Jun 2022 19:42:08 +0200 Subject: Regenerate API files using latest matrix-spec New: - refresh tokens support (changes in login.* and registration.*; RefreshJob); - GetRelatingEvents[WithRelType[AndEventType]]Job Changed space_hierarchy.*: - childrenState is of type StateEvents now; limit and maxDepth are (omittable) integers, not doubles. - no more unused `stripped_state.h` file inclusion. --- lib/csapi/registration.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/csapi/registration.cpp') diff --git a/lib/csapi/registration.cpp b/lib/csapi/registration.cpp index aa4b4fad..3541724b 100644 --- a/lib/csapi/registration.cpp +++ b/lib/csapi/registration.cpp @@ -18,7 +18,8 @@ RegisterJob::RegisterJob(const QString& kind, const QString& username, const QString& password, const QString& deviceId, const QString& initialDeviceDisplayName, - Omittable inhibitLogin) + Omittable inhibitLogin, + Omittable refreshToken) : BaseJob(HttpVerb::Post, QStringLiteral("RegisterJob"), makePath("/_matrix/client/v3", "/register"), queryToRegister(kind), {}, false) @@ -31,6 +32,7 @@ RegisterJob::RegisterJob(const QString& kind, addParam(_data, QStringLiteral("initial_device_display_name"), initialDeviceDisplayName); addParam(_data, QStringLiteral("inhibit_login"), inhibitLogin); + addParam(_data, QStringLiteral("refresh_token"), refreshToken); setRequestData(std::move(_data)); addExpectedKey("user_id"); } -- cgit v1.2.3 From 2dd85770cbfd6d9c7506757f25765c05ef74987d Mon Sep 17 00:00:00 2001 From: Alexey Rusakov Date: Thu, 16 Jun 2022 13:29:02 +0200 Subject: Regenerate API files upon the previous commit --- lib/csapi/registration.cpp | 48 +++++++++++++++++++++++++--------------------- 1 file changed, 26 insertions(+), 22 deletions(-) (limited to 'lib/csapi/registration.cpp') diff --git a/lib/csapi/registration.cpp b/lib/csapi/registration.cpp index 3541724b..04c0fe12 100644 --- a/lib/csapi/registration.cpp +++ b/lib/csapi/registration.cpp @@ -24,16 +24,19 @@ RegisterJob::RegisterJob(const QString& kind, makePath("/_matrix/client/v3", "/register"), queryToRegister(kind), {}, false) { - QJsonObject _data; - addParam(_data, QStringLiteral("auth"), auth); - addParam(_data, QStringLiteral("username"), username); - addParam(_data, QStringLiteral("password"), password); - addParam(_data, QStringLiteral("device_id"), deviceId); - addParam(_data, QStringLiteral("initial_device_display_name"), + QJsonObject _dataJson; + addParam(_dataJson, QStringLiteral("auth"), auth); + addParam(_dataJson, QStringLiteral("username"), username); + addParam(_dataJson, QStringLiteral("password"), password); + addParam(_dataJson, QStringLiteral("device_id"), deviceId); + addParam(_dataJson, + QStringLiteral("initial_device_display_name"), initialDeviceDisplayName); - addParam(_data, QStringLiteral("inhibit_login"), inhibitLogin); - addParam(_data, QStringLiteral("refresh_token"), refreshToken); - setRequestData(std::move(_data)); + addParam(_dataJson, QStringLiteral("inhibit_login"), + inhibitLogin); + addParam(_dataJson, QStringLiteral("refresh_token"), + refreshToken); + setRequestData({ _dataJson }); addExpectedKey("user_id"); } @@ -43,7 +46,7 @@ RequestTokenToRegisterEmailJob::RequestTokenToRegisterEmailJob( makePath("/_matrix/client/v3", "/register/email/requestToken"), false) { - setRequestData(RequestData(toJson(body))); + setRequestData({ toJson(body) }); } RequestTokenToRegisterMSISDNJob::RequestTokenToRegisterMSISDNJob( @@ -52,7 +55,7 @@ RequestTokenToRegisterMSISDNJob::RequestTokenToRegisterMSISDNJob( makePath("/_matrix/client/v3", "/register/msisdn/requestToken"), false) { - setRequestData(RequestData(toJson(body))); + setRequestData({ toJson(body) }); } ChangePasswordJob::ChangePasswordJob(const QString& newPassword, @@ -61,11 +64,12 @@ ChangePasswordJob::ChangePasswordJob(const QString& newPassword, : BaseJob(HttpVerb::Post, QStringLiteral("ChangePasswordJob"), makePath("/_matrix/client/v3", "/account/password")) { - QJsonObject _data; - addParam<>(_data, QStringLiteral("new_password"), newPassword); - addParam(_data, QStringLiteral("logout_devices"), logoutDevices); - addParam(_data, QStringLiteral("auth"), auth); - setRequestData(std::move(_data)); + QJsonObject _dataJson; + addParam<>(_dataJson, QStringLiteral("new_password"), newPassword); + addParam(_dataJson, QStringLiteral("logout_devices"), + logoutDevices); + addParam(_dataJson, QStringLiteral("auth"), auth); + setRequestData({ _dataJson }); } RequestTokenToResetPasswordEmailJob::RequestTokenToResetPasswordEmailJob( @@ -76,7 +80,7 @@ RequestTokenToResetPasswordEmailJob::RequestTokenToResetPasswordEmailJob( "/account/password/email/requestToken"), false) { - setRequestData(RequestData(toJson(body))); + setRequestData({ toJson(body) }); } RequestTokenToResetPasswordMSISDNJob::RequestTokenToResetPasswordMSISDNJob( @@ -87,7 +91,7 @@ RequestTokenToResetPasswordMSISDNJob::RequestTokenToResetPasswordMSISDNJob( "/account/password/msisdn/requestToken"), false) { - setRequestData(RequestData(toJson(body))); + setRequestData({ toJson(body) }); } DeactivateAccountJob::DeactivateAccountJob( @@ -95,10 +99,10 @@ DeactivateAccountJob::DeactivateAccountJob( : BaseJob(HttpVerb::Post, QStringLiteral("DeactivateAccountJob"), makePath("/_matrix/client/v3", "/account/deactivate")) { - QJsonObject _data; - addParam(_data, QStringLiteral("auth"), auth); - addParam(_data, QStringLiteral("id_server"), idServer); - setRequestData(std::move(_data)); + QJsonObject _dataJson; + addParam(_dataJson, QStringLiteral("auth"), auth); + addParam(_dataJson, QStringLiteral("id_server"), idServer); + setRequestData({ _dataJson }); addExpectedKey("id_server_unbind_result"); } -- cgit v1.2.3