Conform more of the codebase to strictNullChecks (#10842)
This commit is contained in:
committed by
GitHub
parent
5eea2c8b02
commit
82e32035fd
@@ -30,7 +30,7 @@ import { logger } from "matrix-js-sdk/src/logger";
|
||||
|
||||
import { MatrixClientPeg } from "./MatrixClientPeg";
|
||||
import Modal, { IHandle } from "./Modal";
|
||||
import { _t } from "./languageHandler";
|
||||
import { _t, UserFriendlyError } from "./languageHandler";
|
||||
import dis from "./dispatcher/dispatcher";
|
||||
import * as Rooms from "./Rooms";
|
||||
import { getAddressType } from "./UserAddress";
|
||||
@@ -121,14 +121,23 @@ export default async function createRoom(opts: IOpts): Promise<string | null> {
|
||||
case "mx-user-id":
|
||||
createOpts.invite = [opts.dmUserId];
|
||||
break;
|
||||
case "email":
|
||||
case "email": {
|
||||
const isUrl = MatrixClientPeg.get().getIdentityServerUrl(true);
|
||||
if (!isUrl) {
|
||||
throw new UserFriendlyError(
|
||||
"Cannot invite user by email without an identity server. " +
|
||||
'You can connect to one under "Settings".',
|
||||
);
|
||||
}
|
||||
createOpts.invite_3pid = [
|
||||
{
|
||||
id_server: MatrixClientPeg.get().getIdentityServerUrl(true),
|
||||
id_server: isUrl,
|
||||
medium: "email",
|
||||
address: opts.dmUserId,
|
||||
},
|
||||
];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (opts.dmUserId && createOpts.is_direct === undefined) {
|
||||
|
||||
Reference in New Issue
Block a user