Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/createRoom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,9 @@ export default async function createRoom(client: MatrixClient, opts: IOpts): Pro
const createOpts: ICreateRoomOpts = opts.createOpts || {};
createOpts.preset = createOpts.preset || defaultPreset;
createOpts.visibility = createOpts.visibility || Visibility.Private;
if (opts.dmUserId && createOpts.invite === undefined) {

// We allow UX of DMing ourselves as a form of creating a personal room but the server doesn't like this so strip it
if (opts.dmUserId && opts.dmUserId !== client.getUserId() && createOpts.invite === undefined) {
switch (getAddressType(opts.dmUserId)) {
case "mx-user-id":
createOpts.invite = [opts.dmUserId];
Expand Down