diff --git a/lib/client.js b/lib/client.js index 7bbb99f9b..a20c9de9c 100644 --- a/lib/client.js +++ b/lib/client.js @@ -197,7 +197,7 @@ MatrixClient.prototype.getIdentityServerUrl = function() { */ MatrixClient.prototype.getDomain = function() { if (this.credentials && this.credentials.userId) { - return this.credentials.userId.split(':')[0]; + return this.credentials.userId.replace(/^.*?:/, ''); } return null; };