Move room name, avatar, and topic to IOpts. (#30981)
This commit is contained in:
+21
-1
@@ -49,7 +49,19 @@ import { ElementCallEventType, ElementCallMemberEventType } from "./call-types";
|
||||
|
||||
export interface IOpts {
|
||||
dmUserId?: string;
|
||||
createOpts?: ICreateRoomOpts;
|
||||
/**
|
||||
* The name of the room to be created.
|
||||
*/
|
||||
name?: string;
|
||||
/**
|
||||
* The topic for the room.
|
||||
*/
|
||||
topic?: string;
|
||||
/**
|
||||
* Additional options to pass to the room creation API.
|
||||
* Note: "name", "topic", and "avatar" should be set via their respective properties in IOpts.
|
||||
*/
|
||||
createOpts?: Omit<ICreateRoomOpts, "name" | "topic" | "avatar">;
|
||||
spinner?: boolean;
|
||||
guestAccess?: boolean;
|
||||
encryption?: boolean;
|
||||
@@ -251,6 +263,14 @@ export default async function createRoom(client: MatrixClient, opts: IOpts): Pro
|
||||
});
|
||||
}
|
||||
|
||||
if (opts.name) {
|
||||
createOpts.name = opts.name;
|
||||
}
|
||||
|
||||
if (opts.topic) {
|
||||
createOpts.topic = opts.topic;
|
||||
}
|
||||
|
||||
if (opts.avatar) {
|
||||
let url = opts.avatar;
|
||||
if (opts.avatar instanceof File) {
|
||||
|
||||
Reference in New Issue
Block a user