From 096fbd4ed4033bbf770769b50ed709862c369281 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Fri, 26 Jan 2018 20:54:13 +0900 Subject: Connection::createRoom and Connection::createDirectChat --- connection.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'connection.cpp') diff --git a/connection.cpp b/connection.cpp index 51a73e8d..00116c5f 100644 --- a/connection.cpp +++ b/connection.cpp @@ -386,6 +386,27 @@ DownloadFileJob* Connection::downloadFile(const QUrl& url, return job; } +CreateRoomJob* Connection::createRoom(RoomVisibility visibility, + const QString& alias, const QString& name, const QString& topic, + const QVector& invites, const QString& presetName, + bool isDirect, bool guestsCanJoin, + const QVector& initialState, + const QVector& invite3pids, + const QJsonObject creationContent) +{ + return callApi( + visibility == PublishRoom ? "public" : "private", alias, name, + topic, invites, invite3pids, creationContent, initialState, + presetName, isDirect, guestsCanJoin); +} + +CreateRoomJob* Connection::createDirectChat(const QString& userId, + const QString& topic, const QString& name) +{ + return createRoom(UnpublishRoom, "", name, topic, {userId}, + "trusted_private_chat", true); +} + ForgetRoomJob* Connection::forgetRoom(const QString& id) { // To forget is hard :) First we should ensure the local user is not -- cgit v1.2.3