aboutsummaryrefslogtreecommitdiff
path: root/lib/csapi/create_room.cpp
diff options
context:
space:
mode:
authorn-peugnet <n.peugnet@free.fr>2022-10-06 19:27:24 +0200
committern-peugnet <n.peugnet@free.fr>2022-10-06 19:27:24 +0200
commit08632625e1a04257b5c7d4a9db2246ac07436748 (patch)
tree9ddadf219a7e352ddd3549ad1683282c944adfb6 /lib/csapi/create_room.cpp
parente9c2e2a26d3711e755aa5eb8a8478917c71d612b (diff)
parentd911b207f49e936b3e992200796110f0749ed150 (diff)
downloadlibquotient-08632625e1a04257b5c7d4a9db2246ac07436748.tar.gz
libquotient-08632625e1a04257b5c7d4a9db2246ac07436748.zip
Update upstream source from tag 'upstream/0.7.0'
Update to upstream version '0.7.0' with Debian dir 30dcb77a77433e4a54eab77c0b82ae925dead2d8
Diffstat (limited to 'lib/csapi/create_room.cpp')
-rw-r--r--lib/csapi/create_room.cpp34
1 files changed, 17 insertions, 17 deletions
diff --git a/lib/csapi/create_room.cpp b/lib/csapi/create_room.cpp
index a94f9951..afae80af 100644
--- a/lib/csapi/create_room.cpp
+++ b/lib/csapi/create_room.cpp
@@ -4,8 +4,6 @@
#include "create_room.h"
-#include <QtCore/QStringBuilder>
-
using namespace Quotient;
CreateRoomJob::CreateRoomJob(const QString& visibility,
@@ -18,24 +16,26 @@ CreateRoomJob::CreateRoomJob(const QString& visibility,
const QString& preset, Omittable<bool> isDirect,
const QJsonObject& powerLevelContentOverride)
: BaseJob(HttpVerb::Post, QStringLiteral("CreateRoomJob"),
- QStringLiteral("/_matrix/client/r0") % "/createRoom")
+ 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");
}