diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-01-26 20:54:13 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-01-30 16:07:52 +0900 |
commit | 096fbd4ed4033bbf770769b50ed709862c369281 (patch) | |
tree | 0d7459cea942c0267e6acd1e3a691ad8dc8f9a14 /connection.cpp | |
parent | 2393ea6a1c43f2e7ac7bcb5d7fb4915cec09f2e3 (diff) | |
download | libquotient-096fbd4ed4033bbf770769b50ed709862c369281.tar.gz libquotient-096fbd4ed4033bbf770769b50ed709862c369281.zip |
Connection::createRoom and Connection::createDirectChat
Diffstat (limited to 'connection.cpp')
-rw-r--r-- | connection.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
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<QString>& invites, const QString& presetName, + bool isDirect, bool guestsCanJoin, + const QVector<CreateRoomJob::StateEvent>& initialState, + const QVector<CreateRoomJob::Invite3pid>& invite3pids, + const QJsonObject creationContent) +{ + return callApi<CreateRoomJob>( + 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 |