Avoid using deprecated exports, fields, and duplicate code (#12555)
This commit is contained in:
parent
1973197eb6
commit
148a360598
33 changed files with 258 additions and 108 deletions
|
@ -78,15 +78,6 @@ export interface IMatrixClientPeg {
|
|||
*/
|
||||
opts: IStartClientOpts;
|
||||
|
||||
/**
|
||||
* Return the server name of the user's homeserver
|
||||
* Throws an error if unable to deduce the homeserver name
|
||||
* (e.g. if the user is not logged in)
|
||||
*
|
||||
* @returns {string} The homeserver name, if present.
|
||||
*/
|
||||
getHomeserverName(): string;
|
||||
|
||||
/**
|
||||
* Get the current MatrixClient, if any
|
||||
*/
|
||||
|
@ -384,14 +375,6 @@ class MatrixClientPegClass implements IMatrixClientPeg {
|
|||
logger.log(`MatrixClientPeg: MatrixClient started`);
|
||||
}
|
||||
|
||||
public getHomeserverName(): string {
|
||||
const matches = /^@[^:]+:(.+)$/.exec(this.safeGet().getSafeUserId());
|
||||
if (matches === null || matches.length < 1) {
|
||||
throw new Error("Failed to derive homeserver name from user ID!");
|
||||
}
|
||||
return matches[1];
|
||||
}
|
||||
|
||||
private namesToRoomName(names: string[], count: number): string | undefined {
|
||||
const countWithoutMe = count - 1;
|
||||
if (!names.length) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue