Spell homeserver correctly
This commit is contained in:
parent
6905e3e54c
commit
68ae72f855
12 changed files with 27 additions and 27 deletions
|
@ -85,7 +85,7 @@ class MatrixClientPeg {
|
|||
|
||||
/**
|
||||
* Replace this MatrixClientPeg's client with a client instance that has
|
||||
* Home Server / Identity Server URLs and active credentials
|
||||
* homeserver / identity server URLs and active credentials
|
||||
*/
|
||||
replaceUsingCreds(creds: MatrixClientCreds) {
|
||||
this._currentClientCreds = creds;
|
||||
|
@ -164,14 +164,14 @@ class MatrixClientPeg {
|
|||
}
|
||||
|
||||
/**
|
||||
* Return the server name of the user's home server
|
||||
* Throws an error if unable to deduce the home server name
|
||||
* Return the server name of the user's homeserver
|
||||
* Throws an error if unable to deduce the homeserver name
|
||||
* (eg. if the user is not logged in)
|
||||
*/
|
||||
getHomeServerName() {
|
||||
const matches = /^@.+:(.+)$/.exec(this.matrixClient.credentials.userId);
|
||||
if (matches === null || matches.length < 1) {
|
||||
throw new Error("Failed to derive home server name from user ID!");
|
||||
throw new Error("Failed to derive homeserver name from user ID!");
|
||||
}
|
||||
return matches[1];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue