From df0927e8be4ea9c5cec06ed7eaee0ccf44a0942f Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Sat, 16 Jun 2018 20:51:33 +0900 Subject: Connection::createRoom: avoid inviting yourself to the created room --- lib/connection.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/connection.cpp b/lib/connection.cpp index d92071df..6c04cf08 100644 --- a/lib/connection.cpp +++ b/lib/connection.cpp @@ -465,9 +465,12 @@ CreateRoomJob* Connection::createRoom(RoomVisibility visibility, const QVector& invite3pids, const QJsonObject& creationContent) { + // FIXME: switch to using QStringList instead of const QStringList& in 0.4 + auto filteredInvites = invites; + filteredInvites.removeOne(d->userId); // The creator is by definition in the room auto job = callApi( visibility == PublishRoom ? "public" : "private", alias, name, - topic, invites, invite3pids, creationContent, initialState, + topic, filteredInvites, invite3pids, creationContent, initialState, presetName, isDirect, guestsCanJoin); connect(job, &BaseJob::success, this, [this,job] { emit createdRoom(provideRoom(job->roomId(), JoinState::Join)); -- cgit v1.2.3