diff options
author | Josip Delic <delijati@googlemail.com> | 2018-08-29 21:56:21 +0200 |
---|---|---|
committer | Josip Delic <delijati@googlemail.com> | 2018-08-29 21:56:21 +0200 |
commit | 6bb64db38f4a5f47d275a663861fd216f1bcf612 (patch) | |
tree | cf92c21991282852e2ae549cd950984a7ae64fc6 /lib/csapi/create_room.cpp | |
parent | 8d07a6bec2689a81c3c3db64e5457143bd671223 (diff) | |
parent | d9ff200ff62fb7f5b6b51082dc3979d5454a1bec (diff) | |
download | libquotient-6bb64db38f4a5f47d275a663861fd216f1bcf612.tar.gz libquotient-6bb64db38f4a5f47d275a663861fd216f1bcf612.zip |
Merge branch 'master' of https://github.com/QMatrixClient/libqmatrixclient
Diffstat (limited to 'lib/csapi/create_room.cpp')
-rw-r--r-- | lib/csapi/create_room.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/csapi/create_room.cpp b/lib/csapi/create_room.cpp index 534f8fdd..068b567f 100644 --- a/lib/csapi/create_room.cpp +++ b/lib/csapi/create_room.cpp @@ -43,7 +43,7 @@ class CreateRoomJob::Private static const auto CreateRoomJobName = QStringLiteral("CreateRoomJob"); -CreateRoomJob::CreateRoomJob(const QString& visibility, const QString& roomAliasName, const QString& name, const QString& topic, const QStringList& invite, const QVector<Invite3pid>& invite3pid, const QJsonObject& creationContent, const QVector<StateEvent>& initialState, const QString& preset, bool isDirect, bool guestCanJoin) +CreateRoomJob::CreateRoomJob(const QString& visibility, const QString& roomAliasName, const QString& name, const QString& topic, const QStringList& invite, const QVector<Invite3pid>& invite3pid, const QString& roomVersion, const QJsonObject& creationContent, const QVector<StateEvent>& initialState, const QString& preset, bool isDirect, const QJsonObject& powerLevelContentOverride) : BaseJob(HttpVerb::Post, CreateRoomJobName, basePath % "/createRoom") , d(new Private) @@ -55,11 +55,12 @@ CreateRoomJob::CreateRoomJob(const QString& visibility, const QString& roomAlias 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"), 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("guest_can_join"), guestCanJoin); + addParam<IfNotEmpty>(_data, QStringLiteral("power_level_content_override"), powerLevelContentOverride); setRequestData(_data); } @@ -73,6 +74,9 @@ const QString& CreateRoomJob::roomId() const BaseJob::Status CreateRoomJob::parseJson(const QJsonDocument& data) { auto json = data.object(); + if (!json.contains("room_id"_ls)) + return { JsonParseError, + "The key 'room_id' not found in the response" }; d->roomId = fromJson<QString>(json.value("room_id"_ls)); return Success; } |