diff --git a/lib/client.js b/lib/client.js index 8ea601f7e..2468e2de5 100644 --- a/lib/client.js +++ b/lib/client.js @@ -191,6 +191,14 @@ MatrixClient.prototype.getIdentityServerUrl = function() { return this.idBaseUrl; }; +/** + * Get the domain for this client's MXID + * @return {string} Domain of this MXID + */ +MatrixClient.prototype.getDomain = function() { + return this.credentials.userId.replace(/^.*:/, ''); +}; + /** * Check if the runtime environment supports VoIP calling. * @return {boolean} True if VoIP is supported.