aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2019-02-05 19:14:55 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2019-02-11 08:24:14 +0900
commite9ace5cbe8a930a8aa3cc81df1a4f73d51c5fa90 (patch)
treed6c2a240af68fc1b1cf93fe7885a07137a3ae742 /lib
parent7337876aac42552da6d926b38d7466cf2e51b7d8 (diff)
downloadlibquotient-e9ace5cbe8a930a8aa3cc81df1a4f73d51c5fa90.tar.gz
libquotient-e9ace5cbe8a930a8aa3cc81df1a4f73d51c5fa90.zip
Connection::createRoom: support passing a room version
On the path to address #233.
Diffstat (limited to 'lib')
-rw-r--r--lib/connection.cpp7
-rw-r--r--lib/connection.h2
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<CreateRoomJob::StateEvent>& initialState,
const QVector<CreateRoomJob::Invite3pid>& invite3pids,
const QJsonObject& creationContent)
@@ -546,7 +547,7 @@ CreateRoomJob* Connection::createRoom(RoomVisibility visibility,
auto job = callApi<CreateRoomJob>(
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<CreateRoomJob::StateEvent>& initialState = {},
const QVector<CreateRoomJob::Invite3pid>& invite3pids = {},
const QJsonObject& creationContent = {});