diff options
Diffstat (limited to 'lib')
39 files changed, 243 insertions, 231 deletions
diff --git a/lib/csapi/account-data.cpp b/lib/csapi/account-data.cpp index 1343eb98..8c71f6c5 100644 --- a/lib/csapi/account-data.cpp +++ b/lib/csapi/account-data.cpp @@ -12,7 +12,7 @@ SetAccountDataJob::SetAccountDataJob(const QString& userId, const QString& type, makePath("/_matrix/client/v3", "/user/", userId, "/account_data/", type)) { - setRequestData(RequestData(toJson(content))); + setRequestData({ toJson(content) }); } QUrl GetAccountDataJob::makeRequestUrl(QUrl baseUrl, const QString& userId, @@ -37,7 +37,7 @@ SetAccountDataPerRoomJob::SetAccountDataPerRoomJob(const QString& userId, makePath("/_matrix/client/v3", "/user/", userId, "/rooms/", roomId, "/account_data/", type)) { - setRequestData(RequestData(toJson(content))); + setRequestData({ toJson(content) }); } QUrl GetAccountDataPerRoomJob::makeRequestUrl(QUrl baseUrl, diff --git a/lib/csapi/administrative_contact.cpp b/lib/csapi/administrative_contact.cpp index f52e2e1f..aa55d934 100644 --- a/lib/csapi/administrative_contact.cpp +++ b/lib/csapi/administrative_contact.cpp @@ -21,9 +21,9 @@ Post3PIDsJob::Post3PIDsJob(const ThreePidCredentials& threePidCreds) : BaseJob(HttpVerb::Post, QStringLiteral("Post3PIDsJob"), makePath("/_matrix/client/v3", "/account/3pid")) { - QJsonObject _data; - addParam<>(_data, QStringLiteral("three_pid_creds"), threePidCreds); - setRequestData(std::move(_data)); + QJsonObject _dataJson; + addParam<>(_dataJson, QStringLiteral("three_pid_creds"), threePidCreds); + setRequestData({ _dataJson }); } Add3PIDJob::Add3PIDJob(const QString& clientSecret, const QString& sid, @@ -31,11 +31,11 @@ Add3PIDJob::Add3PIDJob(const QString& clientSecret, const QString& sid, : BaseJob(HttpVerb::Post, QStringLiteral("Add3PIDJob"), makePath("/_matrix/client/v3", "/account/3pid/add")) { - QJsonObject _data; - addParam<IfNotEmpty>(_data, QStringLiteral("auth"), auth); - addParam<>(_data, QStringLiteral("client_secret"), clientSecret); - addParam<>(_data, QStringLiteral("sid"), sid); - setRequestData(std::move(_data)); + QJsonObject _dataJson; + addParam<IfNotEmpty>(_dataJson, QStringLiteral("auth"), auth); + addParam<>(_dataJson, QStringLiteral("client_secret"), clientSecret); + addParam<>(_dataJson, QStringLiteral("sid"), sid); + setRequestData({ _dataJson }); } Bind3PIDJob::Bind3PIDJob(const QString& clientSecret, const QString& idServer, @@ -43,12 +43,12 @@ Bind3PIDJob::Bind3PIDJob(const QString& clientSecret, const QString& idServer, : BaseJob(HttpVerb::Post, QStringLiteral("Bind3PIDJob"), makePath("/_matrix/client/v3", "/account/3pid/bind")) { - QJsonObject _data; - addParam<>(_data, QStringLiteral("client_secret"), clientSecret); - addParam<>(_data, QStringLiteral("id_server"), idServer); - addParam<>(_data, QStringLiteral("id_access_token"), idAccessToken); - addParam<>(_data, QStringLiteral("sid"), sid); - setRequestData(std::move(_data)); + QJsonObject _dataJson; + addParam<>(_dataJson, QStringLiteral("client_secret"), clientSecret); + addParam<>(_dataJson, QStringLiteral("id_server"), idServer); + addParam<>(_dataJson, QStringLiteral("id_access_token"), idAccessToken); + addParam<>(_dataJson, QStringLiteral("sid"), sid); + setRequestData({ _dataJson }); } Delete3pidFromAccountJob::Delete3pidFromAccountJob(const QString& medium, @@ -57,11 +57,11 @@ Delete3pidFromAccountJob::Delete3pidFromAccountJob(const QString& medium, : BaseJob(HttpVerb::Post, QStringLiteral("Delete3pidFromAccountJob"), makePath("/_matrix/client/v3", "/account/3pid/delete")) { - QJsonObject _data; - addParam<IfNotEmpty>(_data, QStringLiteral("id_server"), idServer); - addParam<>(_data, QStringLiteral("medium"), medium); - addParam<>(_data, QStringLiteral("address"), address); - setRequestData(std::move(_data)); + QJsonObject _dataJson; + addParam<IfNotEmpty>(_dataJson, QStringLiteral("id_server"), idServer); + addParam<>(_dataJson, QStringLiteral("medium"), medium); + addParam<>(_dataJson, QStringLiteral("address"), address); + setRequestData({ _dataJson }); addExpectedKey("id_server_unbind_result"); } @@ -71,11 +71,11 @@ Unbind3pidFromAccountJob::Unbind3pidFromAccountJob(const QString& medium, : BaseJob(HttpVerb::Post, QStringLiteral("Unbind3pidFromAccountJob"), makePath("/_matrix/client/v3", "/account/3pid/unbind")) { - QJsonObject _data; - addParam<IfNotEmpty>(_data, QStringLiteral("id_server"), idServer); - addParam<>(_data, QStringLiteral("medium"), medium); - addParam<>(_data, QStringLiteral("address"), address); - setRequestData(std::move(_data)); + QJsonObject _dataJson; + addParam<IfNotEmpty>(_dataJson, QStringLiteral("id_server"), idServer); + addParam<>(_dataJson, QStringLiteral("medium"), medium); + addParam<>(_dataJson, QStringLiteral("address"), address); + setRequestData({ _dataJson }); addExpectedKey("id_server_unbind_result"); } @@ -86,7 +86,7 @@ RequestTokenTo3PIDEmailJob::RequestTokenTo3PIDEmailJob( "/account/3pid/email/requestToken"), false) { - setRequestData(RequestData(toJson(body))); + setRequestData({ toJson(body) }); } RequestTokenTo3PIDMSISDNJob::RequestTokenTo3PIDMSISDNJob( @@ -96,5 +96,5 @@ RequestTokenTo3PIDMSISDNJob::RequestTokenTo3PIDMSISDNJob( "/account/3pid/msisdn/requestToken"), false) { - setRequestData(RequestData(toJson(body))); + setRequestData({ toJson(body) }); } diff --git a/lib/csapi/appservice_room_directory.cpp b/lib/csapi/appservice_room_directory.cpp index c989559f..dff7e032 100644 --- a/lib/csapi/appservice_room_directory.cpp +++ b/lib/csapi/appservice_room_directory.cpp @@ -15,7 +15,7 @@ UpdateAppserviceRoomDirectoryVisibilityJob:: makePath("/_matrix/client/v3", "/directory/list/appservice/", networkId, "/", roomId)) { - QJsonObject _data; - addParam<>(_data, QStringLiteral("visibility"), visibility); - setRequestData(std::move(_data)); + QJsonObject _dataJson; + addParam<>(_dataJson, QStringLiteral("visibility"), visibility); + setRequestData({ _dataJson }); } diff --git a/lib/csapi/banning.cpp b/lib/csapi/banning.cpp index 77047e89..e04075b7 100644 --- a/lib/csapi/banning.cpp +++ b/lib/csapi/banning.cpp @@ -11,10 +11,10 @@ BanJob::BanJob(const QString& roomId, const QString& userId, : BaseJob(HttpVerb::Post, QStringLiteral("BanJob"), makePath("/_matrix/client/v3", "/rooms/", roomId, "/ban")) { - QJsonObject _data; - addParam<>(_data, QStringLiteral("user_id"), userId); - addParam<IfNotEmpty>(_data, QStringLiteral("reason"), reason); - setRequestData(std::move(_data)); + QJsonObject _dataJson; + addParam<>(_dataJson, QStringLiteral("user_id"), userId); + addParam<IfNotEmpty>(_dataJson, QStringLiteral("reason"), reason); + setRequestData({ _dataJson }); } UnbanJob::UnbanJob(const QString& roomId, const QString& userId, @@ -22,8 +22,8 @@ UnbanJob::UnbanJob(const QString& roomId, const QString& userId, : BaseJob(HttpVerb::Post, QStringLiteral("UnbanJob"), makePath("/_matrix/client/v3", "/rooms/", roomId, "/unban")) { - QJsonObject _data; - addParam<>(_data, QStringLiteral("user_id"), userId); - addParam<IfNotEmpty>(_data, QStringLiteral("reason"), reason); - setRequestData(std::move(_data)); + QJsonObject _dataJson; + addParam<>(_dataJson, QStringLiteral("user_id"), userId); + addParam<IfNotEmpty>(_dataJson, QStringLiteral("reason"), reason); + setRequestData({ _dataJson }); } diff --git a/lib/csapi/content-repo.cpp b/lib/csapi/content-repo.cpp index 7d740cb7..6f6738af 100644 --- a/lib/csapi/content-repo.cpp +++ b/lib/csapi/content-repo.cpp @@ -20,7 +20,7 @@ UploadContentJob::UploadContentJob(QIODevice* content, const QString& filename, queryToUploadContent(filename)) { setRequestHeader("Content-Type", contentType.toLatin1()); - setRequestData(RequestData(content)); + setRequestData({ content }); addExpectedKey("content_uri"); } diff --git a/lib/csapi/create_room.cpp b/lib/csapi/create_room.cpp index 834d8c13..afae80af 100644 --- a/lib/csapi/create_room.cpp +++ b/lib/csapi/create_room.cpp @@ -18,22 +18,24 @@ CreateRoomJob::CreateRoomJob(const QString& visibility, : BaseJob(HttpVerb::Post, QStringLiteral("CreateRoomJob"), makePath("/_matrix/client/v3", "/createRoom")) { - QJsonObject _data; - addParam<IfNotEmpty>(_data, QStringLiteral("visibility"), visibility); - addParam<IfNotEmpty>(_data, QStringLiteral("room_alias_name"), + QJsonObject _dataJson; + addParam<IfNotEmpty>(_dataJson, QStringLiteral("visibility"), visibility); + addParam<IfNotEmpty>(_dataJson, QStringLiteral("room_alias_name"), roomAliasName); - addParam<IfNotEmpty>(_data, QStringLiteral("name"), name); - addParam<IfNotEmpty>(_data, QStringLiteral("topic"), topic); - addParam<IfNotEmpty>(_data, QStringLiteral("invite"), invite); - addParam<IfNotEmpty>(_data, QStringLiteral("invite_3pid"), invite3pid); - addParam<IfNotEmpty>(_data, QStringLiteral("room_version"), roomVersion); - addParam<IfNotEmpty>(_data, QStringLiteral("creation_content"), + addParam<IfNotEmpty>(_dataJson, QStringLiteral("name"), name); + addParam<IfNotEmpty>(_dataJson, QStringLiteral("topic"), topic); + addParam<IfNotEmpty>(_dataJson, QStringLiteral("invite"), invite); + addParam<IfNotEmpty>(_dataJson, QStringLiteral("invite_3pid"), invite3pid); + addParam<IfNotEmpty>(_dataJson, QStringLiteral("room_version"), roomVersion); + addParam<IfNotEmpty>(_dataJson, QStringLiteral("creation_content"), creationContent); - addParam<IfNotEmpty>(_data, QStringLiteral("initial_state"), initialState); - addParam<IfNotEmpty>(_data, QStringLiteral("preset"), preset); - addParam<IfNotEmpty>(_data, QStringLiteral("is_direct"), isDirect); - addParam<IfNotEmpty>(_data, QStringLiteral("power_level_content_override"), + addParam<IfNotEmpty>(_dataJson, QStringLiteral("initial_state"), + initialState); + addParam<IfNotEmpty>(_dataJson, QStringLiteral("preset"), preset); + addParam<IfNotEmpty>(_dataJson, QStringLiteral("is_direct"), isDirect); + addParam<IfNotEmpty>(_dataJson, + QStringLiteral("power_level_content_override"), powerLevelContentOverride); - setRequestData(std::move(_data)); + setRequestData({ _dataJson }); addExpectedKey("room_id"); } diff --git a/lib/csapi/cross_signing.cpp b/lib/csapi/cross_signing.cpp index c6c34772..83136d71 100644 --- a/lib/csapi/cross_signing.cpp +++ b/lib/csapi/cross_signing.cpp @@ -14,14 +14,14 @@ UploadCrossSigningKeysJob::UploadCrossSigningKeysJob( : BaseJob(HttpVerb::Post, QStringLiteral("UploadCrossSigningKeysJob"), makePath("/_matrix/client/v3", "/keys/device_signing/upload")) { - QJsonObject _data; - addParam<IfNotEmpty>(_data, QStringLiteral("master_key"), masterKey); - addParam<IfNotEmpty>(_data, QStringLiteral("self_signing_key"), + QJsonObject _dataJson; + addParam<IfNotEmpty>(_dataJson, QStringLiteral("master_key"), masterKey); + addParam<IfNotEmpty>(_dataJson, QStringLiteral("self_signing_key"), selfSigningKey); - addParam<IfNotEmpty>(_data, QStringLiteral("user_signing_key"), + addParam<IfNotEmpty>(_dataJson, QStringLiteral("user_signing_key"), userSigningKey); - addParam<IfNotEmpty>(_data, QStringLiteral("auth"), auth); - setRequestData(std::move(_data)); + addParam<IfNotEmpty>(_dataJson, QStringLiteral("auth"), auth); + setRequestData({ _dataJson }); } UploadCrossSigningSignaturesJob::UploadCrossSigningSignaturesJob( @@ -29,5 +29,5 @@ UploadCrossSigningSignaturesJob::UploadCrossSigningSignaturesJob( : BaseJob(HttpVerb::Post, QStringLiteral("UploadCrossSigningSignaturesJob"), makePath("/_matrix/client/v3", "/keys/signatures/upload")) { - setRequestData(RequestData(toJson(signatures))); + setRequestData({ toJson(signatures) }); } diff --git a/lib/csapi/device_management.cpp b/lib/csapi/device_management.cpp index fb58633c..6f2badee 100644 --- a/lib/csapi/device_management.cpp +++ b/lib/csapi/device_management.cpp @@ -34,9 +34,9 @@ UpdateDeviceJob::UpdateDeviceJob(const QString& deviceId, : BaseJob(HttpVerb::Put, QStringLiteral("UpdateDeviceJob"), makePath("/_matrix/client/v3", "/devices/", deviceId)) { - QJsonObject _data; - addParam<IfNotEmpty>(_data, QStringLiteral("display_name"), displayName); - setRequestData(std::move(_data)); + QJsonObject _dataJson; + addParam<IfNotEmpty>(_dataJson, QStringLiteral("display_name"), displayName); + setRequestData({ _dataJson }); } DeleteDeviceJob::DeleteDeviceJob(const QString& deviceId, @@ -44,9 +44,9 @@ DeleteDeviceJob::DeleteDeviceJob(const QString& deviceId, : BaseJob(HttpVerb::Delete, QStringLiteral("DeleteDeviceJob"), makePath("/_matrix/client/v3", "/devices/", deviceId)) { - QJsonObject _data; - addParam<IfNotEmpty>(_data, QStringLiteral("auth"), auth); - setRequestData(std::move(_data)); + QJsonObject _dataJson; + addParam<IfNotEmpty>(_dataJson, QStringLiteral("auth"), auth); + setRequestData({ _dataJson }); } DeleteDevicesJob::DeleteDevicesJob(const QStringList& devices, @@ -54,8 +54,8 @@ DeleteDevicesJob::DeleteDevicesJob(const QStringList& devices, : BaseJob(HttpVerb::Post, QStringLiteral("DeleteDevicesJob"), makePath("/_matrix/client/v3", "/delete_devices")) { - QJsonObject _data; - addParam<>(_data, QStringLiteral("devices"), devices); - addParam<IfNotEmpty>(_data, QStringLiteral("auth"), auth); - setRequestData(std::move(_data)); + QJsonObject _dataJson; + addParam<>(_dataJson, QStringLiteral("devices"), devices); + addParam<IfNotEmpty>(_dataJson, QStringLiteral("auth"), auth); + setRequestData({ _dataJson }); } diff --git a/lib/csapi/directory.cpp b/lib/csapi/directory.cpp index 86b14f3a..c1255bb1 100644 --- a/lib/csapi/directory.cpp +++ b/lib/csapi/directory.cpp @@ -10,9 +10,9 @@ SetRoomAliasJob::SetRoomAliasJob(const QString& roomAlias, const QString& roomId : BaseJob(HttpVerb::Put, QStringLiteral("SetRoomAliasJob"), makePath("/_matrix/client/v3", "/directory/room/", roomAlias)) { - QJsonObject _data; - addParam<>(_data, QStringLiteral("room_id"), roomId); - setRequestData(std::move(_data)); + QJsonObject _dataJson; + addParam<>(_dataJson, QStringLiteral("room_id"), roomId); + setRequestData({ _dataJson }); } QUrl GetRoomIdByAliasJob::makeRequestUrl(QUrl baseUrl, const QString& roomAlias) diff --git a/lib/csapi/filter.cpp b/lib/csapi/filter.cpp index 57cb1271..2469fbd1 100644 --- a/lib/csapi/filter.cpp +++ b/lib/csapi/filter.cpp @@ -10,7 +10,7 @@ DefineFilterJob::DefineFilterJob(const QString& userId, const Filter& filter) : BaseJob(HttpVerb::Post, QStringLiteral("DefineFilterJob"), makePath("/_matrix/client/v3", "/user/", userId, "/filter")) { - setRequestData(RequestData(toJson(filter))); + setRequestData({ toJson(filter) }); addExpectedKey("filter_id"); } diff --git a/lib/csapi/inviting.cpp b/lib/csapi/inviting.cpp index bc1863ce..41a8b5be 100644 --- a/lib/csapi/inviting.cpp +++ b/lib/csapi/inviting.cpp @@ -11,8 +11,8 @@ InviteUserJob::InviteUserJob(const QString& roomId, const QString& userId, : BaseJob(HttpVerb::Post, QStringLiteral("InviteUserJob"), makePath("/_matrix/client/v3", "/rooms/", roomId, "/invite")) { - QJsonObject _data; - addParam<>(_data, QStringLiteral("user_id"), userId); - addParam<IfNotEmpty>(_data, QStringLiteral("reason"), reason); - setRequestData(std::move(_data)); + QJsonObject _dataJson; + addParam<>(_dataJson, QStringLiteral("user_id"), userId); + addParam<IfNotEmpty>(_dataJson, QStringLiteral("reason"), reason); + setRequestData({ _dataJson }); } diff --git a/lib/csapi/joining.cpp b/lib/csapi/joining.cpp index b05bd964..cdba95e9 100644 --- a/lib/csapi/joining.cpp +++ b/lib/csapi/joining.cpp @@ -12,11 +12,11 @@ JoinRoomByIdJob::JoinRoomByIdJob( : BaseJob(HttpVerb::Post, QStringLiteral("JoinRoomByIdJob"), makePath("/_matrix/client/v3", "/rooms/", roomId, "/join")) { - QJsonObject _data; - addParam<IfNotEmpty>(_data, QStringLiteral("third_party_signed"), + QJsonObject _dataJson; + addParam<IfNotEmpty>(_dataJson, QStringLiteral("third_party_signed"), thirdPartySigned); - addParam<IfNotEmpty>(_data, QStringLiteral("reason"), reason); - setRequestData(std::move(_data)); + addParam<IfNotEmpty>(_dataJson, QStringLiteral("reason"), reason); + setRequestData({ _dataJson }); addExpectedKey("room_id"); } @@ -35,10 +35,10 @@ JoinRoomJob::JoinRoomJob(const QString& roomIdOrAlias, makePath("/_matrix/client/v3", "/join/", roomIdOrAlias), queryToJoinRoom(serverName)) { - QJsonObject _data; - addParam<IfNotEmpty>(_data, QStringLiteral("third_party_signed"), + QJsonObject _dataJson; + addParam<IfNotEmpty>(_dataJson, QStringLiteral("third_party_signed"), thirdPartySigned); - addParam<IfNotEmpty>(_data, QStringLiteral("reason"), reason); - setRequestData(std::move(_data)); + addParam<IfNotEmpty>(_dataJson, QStringLiteral("reason"), reason); + setRequestData({ _dataJson }); addExpectedKey("room_id"); } diff --git a/lib/csapi/keys.cpp b/lib/csapi/keys.cpp index d4996664..2e4978f2 100644 --- a/lib/csapi/keys.cpp +++ b/lib/csapi/keys.cpp @@ -12,11 +12,13 @@ UploadKeysJob::UploadKeysJob(const Omittable<DeviceKeys>& deviceKeys, : BaseJob(HttpVerb::Post, QStringLiteral("UploadKeysJob"), makePath("/_matrix/client/v3", "/keys/upload")) { - QJsonObject _data; - addParam<IfNotEmpty>(_data, QStringLiteral("device_keys"), deviceKeys); - addParam<IfNotEmpty>(_data, QStringLiteral("one_time_keys"), oneTimeKeys); - addParam<IfNotEmpty>(_data, QStringLiteral("fallback_keys"), fallbackKeys); - setRequestData(std::move(_data)); + QJsonObject _dataJson; + addParam<IfNotEmpty>(_dataJson, QStringLiteral("device_keys"), deviceKeys); + addParam<IfNotEmpty>(_dataJson, QStringLiteral("one_time_keys"), + oneTimeKeys); + addParam<IfNotEmpty>(_dataJson, QStringLiteral("fallback_keys"), + fallbackKeys); + setRequestData({ _dataJson }); addExpectedKey("one_time_key_counts"); } @@ -25,11 +27,11 @@ QueryKeysJob::QueryKeysJob(const QHash<QString, QStringList>& deviceKeys, : BaseJob(HttpVerb::Post, QStringLiteral("QueryKeysJob"), makePath("/_matrix/client/v3", "/keys/query")) { - QJsonObject _data; - addParam<IfNotEmpty>(_data, QStringLiteral("timeout"), timeout); - addParam<>(_data, QStringLiteral("device_keys"), deviceKeys); - addParam<IfNotEmpty>(_data, QStringLiteral("token"), token); - setRequestData(std::move(_data)); + QJsonObject _dataJson; + addParam<IfNotEmpty>(_dataJson, QStringLiteral("timeout"), timeout); + addParam<>(_dataJson, QStringLiteral("device_keys"), deviceKeys); + addParam<IfNotEmpty>(_dataJson, QStringLiteral("token"), token); + setRequestData({ _dataJson }); } ClaimKeysJob::ClaimKeysJob( @@ -38,10 +40,10 @@ ClaimKeysJob::ClaimKeysJob( : BaseJob(HttpVerb::Post, QStringLiteral("ClaimKeysJob"), makePath("/_matrix/client/v3", "/keys/claim")) { - QJsonObject _data; - addParam<IfNotEmpty>(_data, QStringLiteral("timeout"), timeout); - addParam<>(_data, QStringLiteral("one_time_keys"), oneTimeKeys); - setRequestData(std::move(_data)); + QJsonObject _dataJson; + addParam<IfNotEmpty>(_dataJson, QStringLiteral("timeout"), timeout); + addParam<>(_dataJson, QStringLiteral("one_time_keys"), oneTimeKeys); + setRequestData({ _dataJson }); addExpectedKey("one_time_keys"); } diff --git a/lib/csapi/kicking.cpp b/lib/csapi/kicking.cpp index 3bedcb34..4ca39c4c 100644 --- a/lib/csapi/kicking.cpp +++ b/lib/csapi/kicking.cpp @@ -11,8 +11,8 @@ KickJob::KickJob(const QString& roomId, const QString& userId, : BaseJob(HttpVerb::Post, QStringLiteral("KickJob"), makePath("/_matrix/client/v3", "/rooms/", roomId, "/kick")) { - QJsonObject _data; - addParam<>(_data, QStringLiteral("user_id"), userId); - addParam<IfNotEmpty>(_data, QStringLiteral("reason"), reason); - setRequestData(std::move(_data)); + QJsonObject _dataJson; + addParam<>(_dataJson, QStringLiteral("user_id"), userId); + addParam<IfNotEmpty>(_dataJson, QStringLiteral("reason"), reason); + setRequestData({ _dataJson }); } diff --git a/lib/csapi/knocking.cpp b/lib/csapi/knocking.cpp index ba541643..b9da4b9b 100644 --- a/lib/csapi/knocking.cpp +++ b/lib/csapi/knocking.cpp @@ -19,8 +19,8 @@ KnockRoomJob::KnockRoomJob(const QString& roomIdOrAlias, makePath("/_matrix/client/v3", "/knock/", roomIdOrAlias), queryToKnockRoom(serverName)) { - QJsonObject _data; - addParam<IfNotEmpty>(_data, QStringLiteral("reason"), reason); - setRequestData(std::move(_data)); + QJsonObject _dataJson; + addParam<IfNotEmpty>(_dataJson, QStringLiteral("reason"), reason); + setRequestData({ _dataJson }); addExpectedKey("room_id"); } diff --git a/lib/csapi/leaving.cpp b/lib/csapi/leaving.cpp index 84340b94..ba91f26a 100644 --- a/lib/csapi/leaving.cpp +++ b/lib/csapi/leaving.cpp @@ -10,9 +10,9 @@ LeaveRoomJob::LeaveRoomJob(const QString& roomId, const QString& reason) : BaseJob(HttpVerb::Post, QStringLiteral("LeaveRoomJob"), makePath("/_matrix/client/v3", "/rooms/", roomId, "/leave")) { - QJsonObject _data; - addParam<IfNotEmpty>(_data, QStringLiteral("reason"), reason); - setRequestData(std::move(_data)); + QJsonObject _dataJson; + addParam<IfNotEmpty>(_dataJson, QStringLiteral("reason"), reason); + setRequestData({ _dataJson }); } QUrl ForgetRoomJob::makeRequestUrl(QUrl baseUrl, const QString& roomId) diff --git a/lib/csapi/list_public_rooms.cpp b/lib/csapi/list_public_rooms.cpp index 417e50b3..4deecfc2 100644 --- a/lib/csapi/list_public_rooms.cpp +++ b/lib/csapi/list_public_rooms.cpp @@ -26,9 +26,9 @@ SetRoomVisibilityOnDirectoryJob::SetRoomVisibilityOnDirectoryJob( : BaseJob(HttpVerb::Put, QStringLiteral("SetRoomVisibilityOnDirectoryJob"), makePath("/_matrix/client/v3", "/directory/list/room/", roomId)) { - QJsonObject _data; - addParam<IfNotEmpty>(_data, QStringLiteral("visibility"), visibility); - setRequestData(std::move(_data)); + QJsonObject _dataJson; + addParam<IfNotEmpty>(_dataJson, QStringLiteral("visibility"), visibility); + setRequestData({ _dataJson }); } auto queryToGetPublicRooms(Omittable<int> limit, const QString& since, @@ -77,14 +77,14 @@ QueryPublicRoomsJob::QueryPublicRoomsJob(const QString& server, makePath("/_matrix/client/v3", "/publicRooms"), queryToQueryPublicRooms(server)) { - QJsonObject _data; - addParam<IfNotEmpty>(_data, QStringLiteral("limit"), limit); - addParam<IfNotEmpty>(_data, QStringLiteral("since"), since); - addParam<IfNotEmpty>(_data, QStringLiteral("filter"), filter); - addParam<IfNotEmpty>(_data, QStringLiteral("include_all_networks"), + QJsonObject _dataJson; + addParam<IfNotEmpty>(_dataJson, QStringLiteral("limit"), limit); + addParam<IfNotEmpty>(_dataJson, QStringLiteral("since"), since); + addParam<IfNotEmpty>(_dataJson, QStringLiteral("filter"), filter); + addParam<IfNotEmpty>(_dataJson, QStringLiteral("include_all_networks"), includeAllNetworks); - addParam<IfNotEmpty>(_data, QStringLiteral("third_party_instance_id"), + addParam<IfNotEmpty>(_dataJson, QStringLiteral("third_party_instance_id"), thirdPartyInstanceId); - setRequestData(std::move(_data)); + setRequestData({ _dataJson }); addExpectedKey("chunk"); } diff --git a/lib/csapi/login.cpp b/lib/csapi/login.cpp index 5e007d8f..81e603b5 100644 --- a/lib/csapi/login.cpp +++ b/lib/csapi/login.cpp @@ -26,14 +26,16 @@ LoginJob::LoginJob(const QString& type, : BaseJob(HttpVerb::Post, QStringLiteral("LoginJob"), makePath("/_matrix/client/v3", "/login"), false) { - QJsonObject _data; - addParam<>(_data, QStringLiteral("type"), type); - addParam<IfNotEmpty>(_data, QStringLiteral("identifier"), identifier); - addParam<IfNotEmpty>(_data, QStringLiteral("password"), password); - addParam<IfNotEmpty>(_data, QStringLiteral("token"), token); - addParam<IfNotEmpty>(_data, QStringLiteral("device_id"), deviceId); - addParam<IfNotEmpty>(_data, QStringLiteral("initial_device_display_name"), + QJsonObject _dataJson; + addParam<>(_dataJson, QStringLiteral("type"), type); + addParam<IfNotEmpty>(_dataJson, QStringLiteral("identifier"), identifier); + addParam<IfNotEmpty>(_dataJson, QStringLiteral("password"), password); + addParam<IfNotEmpty>(_dataJson, QStringLiteral("token"), token); + addParam<IfNotEmpty>(_dataJson, QStringLiteral("device_id"), deviceId); + addParam<IfNotEmpty>(_dataJson, + QStringLiteral("initial_device_display_name"), initialDeviceDisplayName); - addParam<IfNotEmpty>(_data, QStringLiteral("refresh_token"), refreshToken); - setRequestData(std::move(_data)); + addParam<IfNotEmpty>(_dataJson, QStringLiteral("refresh_token"), + refreshToken); + setRequestData({ _dataJson }); } diff --git a/lib/csapi/openid.cpp b/lib/csapi/openid.cpp index 8349e6db..7e89b8a6 100644 --- a/lib/csapi/openid.cpp +++ b/lib/csapi/openid.cpp @@ -12,5 +12,5 @@ RequestOpenIdTokenJob::RequestOpenIdTokenJob(const QString& userId, makePath("/_matrix/client/v3", "/user/", userId, "/openid/request_token")) { - setRequestData(RequestData(toJson(body))); + setRequestData({ toJson(body) }); } diff --git a/lib/csapi/presence.cpp b/lib/csapi/presence.cpp index 6d154ebd..828ccfb7 100644 --- a/lib/csapi/presence.cpp +++ b/lib/csapi/presence.cpp @@ -11,10 +11,10 @@ SetPresenceJob::SetPresenceJob(const QString& userId, const QString& presence, : BaseJob(HttpVerb::Put, QStringLiteral("SetPresenceJob"), makePath("/_matrix/client/v3", "/presence/", userId, "/status")) { - QJsonObject _data; - addParam<>(_data, QStringLiteral("presence"), presence); - addParam<IfNotEmpty>(_data, QStringLiteral("status_msg"), statusMsg); - setRequestData(std::move(_data)); + QJsonObject _dataJson; + addParam<>(_dataJson, QStringLiteral("presence"), presence); + addParam<IfNotEmpty>(_dataJson, QStringLiteral("status_msg"), statusMsg); + setRequestData({ _dataJson }); } QUrl GetPresenceJob::makeRequestUrl(QUrl baseUrl, const QString& userId) diff --git a/lib/csapi/profile.cpp b/lib/csapi/profile.cpp index 7621d828..f024ed82 100644 --- a/lib/csapi/profile.cpp +++ b/lib/csapi/profile.cpp @@ -12,9 +12,9 @@ SetDisplayNameJob::SetDisplayNameJob(const QString& userId, makePath("/_matrix/client/v3", "/profile/", userId, "/displayname")) { - QJsonObject _data; - addParam<>(_data, QStringLiteral("displayname"), displayname); - setRequestData(std::move(_data)); + QJsonObject _dataJson; + addParam<>(_dataJson, QStringLiteral("displayname"), displayname); + setRequestData({ _dataJson }); } QUrl GetDisplayNameJob::makeRequestUrl(QUrl baseUrl, const QString& userId) @@ -35,9 +35,9 @@ SetAvatarUrlJob::SetAvatarUrlJob(const QString& userId, const QUrl& avatarUrl) : BaseJob(HttpVerb::Put, QStringLiteral("SetAvatarUrlJob"), makePath("/_matrix/client/v3", "/profile/", userId, "/avatar_url")) { - QJsonObject _data; - addParam<>(_data, QStringLiteral("avatar_url"), avatarUrl); - setRequestData(std::move(_data)); + QJsonObject _dataJson; + addParam<>(_dataJson, QStringLiteral("avatar_url"), avatarUrl); + setRequestData({ _dataJson }); } QUrl GetAvatarUrlJob::makeRequestUrl(QUrl baseUrl, const QString& userId) diff --git a/lib/csapi/pusher.cpp b/lib/csapi/pusher.cpp index 498be3ee..fb6595fc 100644 --- a/lib/csapi/pusher.cpp +++ b/lib/csapi/pusher.cpp @@ -25,15 +25,16 @@ PostPusherJob::PostPusherJob(const QString& pushkey, const QString& kind, : BaseJob(HttpVerb::Post, QStringLiteral("PostPusherJob"), makePath("/_matrix/client/v3", "/pushers/set")) { - QJsonObject _data; - addParam<>(_data, QStringLiteral("pushkey"), pushkey); - addParam<>(_data, QStringLiteral("kind"), kind); - addParam<>(_data, QStringLiteral("app_id"), appId); - addParam<>(_data, QStringLiteral("app_display_name"), appDisplayName); - addParam<>(_data, QStringLiteral("device_display_name"), deviceDisplayName); - addParam<IfNotEmpty>(_data, QStringLiteral("profile_tag"), profileTag); - addParam<>(_data, QStringLiteral("lang"), lang); - addParam<>(_data, QStringLiteral("data"), data); - addParam<IfNotEmpty>(_data, QStringLiteral("append"), append); - setRequestData(std::move(_data)); + QJsonObject _dataJson; + addParam<>(_dataJson, QStringLiteral("pushkey"), pushkey); + addParam<>(_dataJson, QStringLiteral("kind"), kind); + addParam<>(_dataJson, QStringLiteral("app_id"), appId); + addParam<>(_dataJson, QStringLiteral("app_display_name"), appDisplayName); + addParam<>(_dataJson, QStringLiteral("device_display_name"), + deviceDisplayName); + addParam<IfNotEmpty>(_dataJson, QStringLiteral("profile_tag"), profileTag); + addParam<>(_dataJson, QStringLiteral("lang"), lang); + addParam<>(_dataJson, QStringLiteral("data"), data); + addParam<IfNotEmpty>(_dataJson, QStringLiteral("append"), append); + setRequestData({ _dataJson }); } diff --git a/lib/csapi/pushrules.cpp b/lib/csapi/pushrules.cpp index 6b0effd4..2376654a 100644 --- a/lib/csapi/pushrules.cpp +++ b/lib/csapi/pushrules.cpp @@ -69,11 +69,11 @@ SetPushRuleJob::SetPushRuleJob(const QString& scope, const QString& kind, "/", ruleId), queryToSetPushRule(before, after)) { - QJsonObject _data; - addParam<>(_data, QStringLiteral("actions"), actions); - addParam<IfNotEmpty>(_data, QStringLiteral("conditions"), conditions); - addParam<IfNotEmpty>(_data, QStringLiteral("pattern"), pattern); - setRequestData(std::move(_data)); + QJsonObject _dataJson; + addParam<>(_dataJson, QStringLiteral("actions"), actions); + addParam<IfNotEmpty>(_dataJson, QStringLiteral("conditions"), conditions); + addParam<IfNotEmpty>(_dataJson, QStringLiteral("pattern"), pattern); + setRequestData({ _dataJson }); } QUrl IsPushRuleEnabledJob::makeRequestUrl(QUrl baseUrl, const QString& scope, @@ -103,9 +103,9 @@ SetPushRuleEnabledJob::SetPushRuleEnabledJob(const QString& scope, makePath("/_matrix/client/v3", "/pushrules/", scope, "/", kind, "/", ruleId, "/enabled")) { - QJsonObject _data; - addParam<>(_data, QStringLiteral("enabled"), enabled); - setRequestData(std::move(_data)); + QJsonObject _dataJson; + addParam<>(_dataJson, QStringLiteral("enabled"), enabled); + setRequestData({ _dataJson }); } QUrl GetPushRuleActionsJob::makeRequestUrl(QUrl baseUrl, const QString& scope, @@ -136,7 +136,7 @@ SetPushRuleActionsJob::SetPushRuleActionsJob(const QString& scope, makePath("/_matrix/client/v3", "/pushrules/", scope, "/", kind, "/", ruleId, "/actions")) { - QJsonObject _data; - addParam<>(_data, QStringLiteral("actions"), actions); - setRequestData(std::move(_data)); + QJsonObject _dataJson; + addParam<>(_dataJson, QStringLiteral("actions"), actions); + setRequestData({ _dataJson }); } diff --git a/lib/csapi/read_markers.cpp b/lib/csapi/read_markers.cpp index dc84f887..de5f4a9a 100644 --- a/lib/csapi/read_markers.cpp +++ b/lib/csapi/read_markers.cpp @@ -12,8 +12,8 @@ SetReadMarkerJob::SetReadMarkerJob(const QString& roomId, : BaseJob(HttpVerb::Post, QStringLiteral("SetReadMarkerJob"), makePath("/_matrix/client/v3", "/rooms/", roomId, "/read_markers")) { - QJsonObject _data; - addParam<>(_data, QStringLiteral("m.fully_read"), mFullyRead); - addParam<IfNotEmpty>(_data, QStringLiteral("m.read"), mRead); - setRequestData(std::move(_data)); + QJsonObject _dataJson; + addParam<>(_dataJson, QStringLiteral("m.fully_read"), mFullyRead); + addParam<IfNotEmpty>(_dataJson, QStringLiteral("m.read"), mRead); + setRequestData({ _dataJson }); } diff --git a/lib/csapi/receipts.cpp b/lib/csapi/receipts.cpp index 8feab986..0194603d 100644 --- a/lib/csapi/receipts.cpp +++ b/lib/csapi/receipts.cpp @@ -13,5 +13,5 @@ PostReceiptJob::PostReceiptJob(const QString& roomId, const QString& receiptType makePath("/_matrix/client/v3", "/rooms/", roomId, "/receipt/", receiptType, "/", eventId)) { - setRequestData(RequestData(toJson(receipt))); + setRequestData({ toJson(receipt) }); } diff --git a/lib/csapi/redaction.cpp b/lib/csapi/redaction.cpp index d67cb37b..154abd9b 100644 --- a/lib/csapi/redaction.cpp +++ b/lib/csapi/redaction.cpp @@ -12,7 +12,7 @@ RedactEventJob::RedactEventJob(const QString& roomId, const QString& eventId, makePath("/_matrix/client/v3", "/rooms/", roomId, "/redact/", eventId, "/", txnId)) { - QJsonObject _data; - addParam<IfNotEmpty>(_data, QStringLiteral("reason"), reason); - setRequestData(std::move(_data)); + QJsonObject _dataJson; + addParam<IfNotEmpty>(_dataJson, QStringLiteral("reason"), reason); + setRequestData({ _dataJson }); } diff --git a/lib/csapi/refresh.cpp b/lib/csapi/refresh.cpp index 8d4a34ae..284ae4ff 100644 --- a/lib/csapi/refresh.cpp +++ b/lib/csapi/refresh.cpp @@ -10,8 +10,9 @@ RefreshJob::RefreshJob(const QString& refreshToken) : BaseJob(HttpVerb::Post, QStringLiteral("RefreshJob"), makePath("/_matrix/client/v3", "/refresh"), false) { - QJsonObject _data; - addParam<IfNotEmpty>(_data, QStringLiteral("refresh_token"), refreshToken); - setRequestData(std::move(_data)); + QJsonObject _dataJson; + addParam<IfNotEmpty>(_dataJson, QStringLiteral("refresh_token"), + refreshToken); + setRequestData({ _dataJson }); addExpectedKey("access_token"); } 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<IfNotEmpty>(_data, QStringLiteral("auth"), auth); - addParam<IfNotEmpty>(_data, QStringLiteral("username"), username); - addParam<IfNotEmpty>(_data, QStringLiteral("password"), password); - addParam<IfNotEmpty>(_data, QStringLiteral("device_id"), deviceId); - addParam<IfNotEmpty>(_data, QStringLiteral("initial_device_display_name"), + QJsonObject _dataJson; + addParam<IfNotEmpty>(_dataJson, QStringLiteral("auth"), auth); + addParam<IfNotEmpty>(_dataJson, QStringLiteral("username"), username); + addParam<IfNotEmpty>(_dataJson, QStringLiteral("password"), password); + addParam<IfNotEmpty>(_dataJson, QStringLiteral("device_id"), deviceId); + addParam<IfNotEmpty>(_dataJson, + QStringLiteral("initial_device_display_name"), initialDeviceDisplayName); - addParam<IfNotEmpty>(_data, QStringLiteral("inhibit_login"), inhibitLogin); - addParam<IfNotEmpty>(_data, QStringLiteral("refresh_token"), refreshToken); - setRequestData(std::move(_data)); + addParam<IfNotEmpty>(_dataJson, QStringLiteral("inhibit_login"), + inhibitLogin); + addParam<IfNotEmpty>(_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<IfNotEmpty>(_data, QStringLiteral("logout_devices"), logoutDevices); - addParam<IfNotEmpty>(_data, QStringLiteral("auth"), auth); - setRequestData(std::move(_data)); + QJsonObject _dataJson; + addParam<>(_dataJson, QStringLiteral("new_password"), newPassword); + addParam<IfNotEmpty>(_dataJson, QStringLiteral("logout_devices"), + logoutDevices); + addParam<IfNotEmpty>(_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<IfNotEmpty>(_data, QStringLiteral("auth"), auth); - addParam<IfNotEmpty>(_data, QStringLiteral("id_server"), idServer); - setRequestData(std::move(_data)); + QJsonObject _dataJson; + addParam<IfNotEmpty>(_dataJson, QStringLiteral("auth"), auth); + addParam<IfNotEmpty>(_dataJson, QStringLiteral("id_server"), idServer); + setRequestData({ _dataJson }); addExpectedKey("id_server_unbind_result"); } diff --git a/lib/csapi/registration.h b/lib/csapi/registration.h index 7a20cab8..21d7f9d7 100644 --- a/lib/csapi/registration.h +++ b/lib/csapi/registration.h @@ -126,7 +126,7 @@ public: /// obtain a new access token when it expires by calling the /// `/refresh` endpoint. /// - /// Omitted if the `inhibit_login` option is false. + /// Omitted if the `inhibit_login` option is true. QString refreshToken() const { return loadFromJson<QString>("refresh_token"_ls); @@ -139,7 +139,7 @@ public: /// to obtain a new access token. If not given, the client can /// assume that the access token will not expire. /// - /// Omitted if the `inhibit_login` option is false. + /// Omitted if the `inhibit_login` option is true. Omittable<int> expiresInMs() const { return loadFromJson<Omittable<int>>("expires_in_ms"_ls); diff --git a/lib/csapi/report_content.cpp b/lib/csapi/report_content.cpp index b8e9a8d1..bc52208f 100644 --- a/lib/csapi/report_content.cpp +++ b/lib/csapi/report_content.cpp @@ -12,8 +12,8 @@ ReportContentJob::ReportContentJob(const QString& roomId, const QString& eventId makePath("/_matrix/client/v3", "/rooms/", roomId, "/report/", eventId)) { - QJsonObject _data; - addParam<IfNotEmpty>(_data, QStringLiteral("score"), score); - addParam<IfNotEmpty>(_data, QStringLiteral("reason"), reason); - setRequestData(std::move(_data)); + QJsonObject _dataJson; + addParam<IfNotEmpty>(_dataJson, QStringLiteral("score"), score); + addParam<IfNotEmpty>(_dataJson, QStringLiteral("reason"), reason); + setRequestData({ _dataJson }); } diff --git a/lib/csapi/room_send.cpp b/lib/csapi/room_send.cpp index 93ab04d2..2319496f 100644 --- a/lib/csapi/room_send.cpp +++ b/lib/csapi/room_send.cpp @@ -12,6 +12,6 @@ SendMessageJob::SendMessageJob(const QString& roomId, const QString& eventType, makePath("/_matrix/client/v3", "/rooms/", roomId, "/send/", eventType, "/", txnId)) { - setRequestData(RequestData(toJson(body))); + setRequestData({ toJson(body) }); addExpectedKey("event_id"); } diff --git a/lib/csapi/room_state.cpp b/lib/csapi/room_state.cpp index 2253863a..b4adb739 100644 --- a/lib/csapi/room_state.cpp +++ b/lib/csapi/room_state.cpp @@ -14,6 +14,6 @@ SetRoomStateWithKeyJob::SetRoomStateWithKeyJob(const QString& roomId, makePath("/_matrix/client/v3", "/rooms/", roomId, "/state/", eventType, "/", stateKey)) { - setRequestData(RequestData(toJson(body))); + setRequestData({ toJson(body) }); addExpectedKey("event_id"); } diff --git a/lib/csapi/room_upgrades.cpp b/lib/csapi/room_upgrades.cpp index 3f67234d..b03fb6e8 100644 --- a/lib/csapi/room_upgrades.cpp +++ b/lib/csapi/room_upgrades.cpp @@ -10,8 +10,8 @@ UpgradeRoomJob::UpgradeRoomJob(const QString& roomId, const QString& newVersion) : BaseJob(HttpVerb::Post, QStringLiteral("UpgradeRoomJob"), makePath("/_matrix/client/v3", "/rooms/", roomId, "/upgrade")) { - QJsonObject _data; - addParam<>(_data, QStringLiteral("new_version"), newVersion); - setRequestData(std::move(_data)); + QJsonObject _dataJson; + addParam<>(_dataJson, QStringLiteral("new_version"), newVersion); + setRequestData({ _dataJson }); addExpectedKey("replacement_room"); } diff --git a/lib/csapi/search.cpp b/lib/csapi/search.cpp index 92300351..4e2c9e92 100644 --- a/lib/csapi/search.cpp +++ b/lib/csapi/search.cpp @@ -19,8 +19,8 @@ SearchJob::SearchJob(const Categories& searchCategories, makePath("/_matrix/client/v3", "/search"), queryToSearch(nextBatch)) { - QJsonObject _data; - addParam<>(_data, QStringLiteral("search_categories"), searchCategories); - setRequestData(std::move(_data)); + QJsonObject _dataJson; + addParam<>(_dataJson, QStringLiteral("search_categories"), searchCategories); + setRequestData({ _dataJson }); addExpectedKey("search_categories"); } diff --git a/lib/csapi/tags.cpp b/lib/csapi/tags.cpp index 21cb18ed..2c85842d 100644 --- a/lib/csapi/tags.cpp +++ b/lib/csapi/tags.cpp @@ -27,10 +27,10 @@ SetRoomTagJob::SetRoomTagJob(const QString& userId, const QString& roomId, makePath("/_matrix/client/v3", "/user/", userId, "/rooms/", roomId, "/tags/", tag)) { - QJsonObject _data; - fillJson(_data, additionalProperties); - addParam<IfNotEmpty>(_data, QStringLiteral("order"), order); - setRequestData(std::move(_data)); + QJsonObject _dataJson; + fillJson(_dataJson, additionalProperties); + addParam<IfNotEmpty>(_dataJson, QStringLiteral("order"), order); + setRequestData({ _dataJson }); } QUrl DeleteRoomTagJob::makeRequestUrl(QUrl baseUrl, const QString& userId, diff --git a/lib/csapi/third_party_membership.cpp b/lib/csapi/third_party_membership.cpp index 2d6df77d..3ca986c7 100644 --- a/lib/csapi/third_party_membership.cpp +++ b/lib/csapi/third_party_membership.cpp @@ -12,10 +12,10 @@ InviteBy3PIDJob::InviteBy3PIDJob(const QString& roomId, const QString& idServer, : BaseJob(HttpVerb::Post, QStringLiteral("InviteBy3PIDJob"), makePath("/_matrix/client/v3", "/rooms/", roomId, "/invite")) { - QJsonObject _data; - addParam<>(_data, QStringLiteral("id_server"), idServer); - addParam<>(_data, QStringLiteral("id_access_token"), idAccessToken); - addParam<>(_data, QStringLiteral("medium"), medium); - addParam<>(_data, QStringLiteral("address"), address); - setRequestData(std::move(_data)); + QJsonObject _dataJson; + addParam<>(_dataJson, QStringLiteral("id_server"), idServer); + addParam<>(_dataJson, QStringLiteral("id_access_token"), idAccessToken); + addParam<>(_dataJson, QStringLiteral("medium"), medium); + addParam<>(_dataJson, QStringLiteral("address"), address); + setRequestData({ _dataJson }); } diff --git a/lib/csapi/to_device.cpp b/lib/csapi/to_device.cpp index 48e943db..e10fac69 100644 --- a/lib/csapi/to_device.cpp +++ b/lib/csapi/to_device.cpp @@ -13,7 +13,7 @@ SendToDeviceJob::SendToDeviceJob( makePath("/_matrix/client/v3", "/sendToDevice/", eventType, "/", txnId)) { - QJsonObject _data; - addParam<>(_data, QStringLiteral("messages"), messages); - setRequestData(std::move(_data)); + QJsonObject _dataJson; + addParam<>(_dataJson, QStringLiteral("messages"), messages); + setRequestData({ _dataJson }); } diff --git a/lib/csapi/typing.cpp b/lib/csapi/typing.cpp index 1b4fe147..21bd45ae 100644 --- a/lib/csapi/typing.cpp +++ b/lib/csapi/typing.cpp @@ -12,8 +12,8 @@ SetTypingJob::SetTypingJob(const QString& userId, const QString& roomId, makePath("/_matrix/client/v3", "/rooms/", roomId, "/typing/", userId)) { - QJsonObject _data; - addParam<>(_data, QStringLiteral("typing"), typing); - addParam<IfNotEmpty>(_data, QStringLiteral("timeout"), timeout); - setRequestData(std::move(_data)); + QJsonObject _dataJson; + addParam<>(_dataJson, QStringLiteral("typing"), typing); + addParam<IfNotEmpty>(_dataJson, QStringLiteral("timeout"), timeout); + setRequestData({ _dataJson }); } diff --git a/lib/csapi/users.cpp b/lib/csapi/users.cpp index e0db6f70..c65280ee 100644 --- a/lib/csapi/users.cpp +++ b/lib/csapi/users.cpp @@ -11,10 +11,10 @@ SearchUserDirectoryJob::SearchUserDirectoryJob(const QString& searchTerm, : BaseJob(HttpVerb::Post, QStringLiteral("SearchUserDirectoryJob"), makePath("/_matrix/client/v3", "/user_directory/search")) { - QJsonObject _data; - addParam<>(_data, QStringLiteral("search_term"), searchTerm); - addParam<IfNotEmpty>(_data, QStringLiteral("limit"), limit); - setRequestData(std::move(_data)); + QJsonObject _dataJson; + addParam<>(_dataJson, QStringLiteral("search_term"), searchTerm); + addParam<IfNotEmpty>(_dataJson, QStringLiteral("limit"), limit); + setRequestData({ _dataJson }); addExpectedKey("results"); addExpectedKey("limited"); } |