From e9ace5cbe8a930a8aa3cc81df1a4f73d51c5fa90 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Tue, 5 Feb 2019 19:14:55 +0900 Subject: Connection::createRoom: support passing a room version On the path to address #233. --- lib/connection.cpp | 7 ++++--- lib/connection.h | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/connection.cpp b/lib/connection.cpp index c582cf94..88fb547f 100644 --- a/lib/connection.cpp +++ b/lib/connection.cpp @@ -537,7 +537,8 @@ DownloadFileJob* Connection::downloadFile(const QUrl& url, CreateRoomJob* Connection::createRoom(RoomVisibility visibility, const QString& alias, const QString& name, const QString& topic, - QStringList invites, const QString& presetName, bool isDirect, + QStringList invites, const QString& presetName, + const QString& roomVersion, bool isDirect, const QVector& initialState, const QVector& invite3pids, const QJsonObject& creationContent) @@ -546,7 +547,7 @@ CreateRoomJob* Connection::createRoom(RoomVisibility visibility, auto job = callApi( visibility == PublishRoom ? QStringLiteral("public") : QStringLiteral("private"), - alias, name, topic, invites, invite3pids, QString(/*TODO: #233*/), + alias, name, topic, invites, invite3pids, roomVersion, creationContent, initialState, presetName, isDirect); connect(job, &BaseJob::success, this, [this,job] { emit createdRoom(provideRoom(job->roomId(), JoinState::Join)); @@ -648,7 +649,7 @@ CreateRoomJob* Connection::createDirectChat(const QString& userId, const QString& topic, const QString& name) { return createRoom(UnpublishRoom, "", name, topic, {userId}, - "trusted_private_chat", true); + "trusted_private_chat", {}, true); } ForgetRoomJob* Connection::forgetRoom(const QString& id) diff --git a/lib/connection.h b/lib/connection.h index 9e4121f4..9e4c1a26 100644 --- a/lib/connection.h +++ b/lib/connection.h @@ -402,7 +402,7 @@ namespace QMatrixClient CreateRoomJob* createRoom(RoomVisibility visibility, const QString& alias, const QString& name, const QString& topic, QStringList invites, const QString& presetName = {}, - bool isDirect = false, + const QString& roomVersion = {}, bool isDirect = false, const QVector& initialState = {}, const QVector& invite3pids = {}, const QJsonObject& creationContent = {}); -- cgit v1.2.3