Spell homeserver correctly

This commit is contained in:
J. Ryan Stinnett 2019-01-31 18:52:39 -06:00
parent 6905e3e54c
commit 68ae72f855
12 changed files with 27 additions and 27 deletions

View file

@ -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];
}