1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-28 05:03:59 +03:00

add room method for alt_aliases

This commit is contained in:
Bruno Windels
2020-02-21 13:37:14 +01:00
parent c14d0616ea
commit c95cdf5a11

View File

@@ -866,6 +866,18 @@ Room.prototype.getCanonicalAlias = function() {
return null;
};
/**
* Get this room's alternative aliases
* @return {[string]} The room's alternative aliases, or an empty array
*/
Room.prototype.getAltAliases = function() {
const canonicalAlias = this.currentState.getStateEvents("m.room.canonical_alias", "");
if (canonicalAlias) {
return canonicalAlias.getContent().alt_aliases || [];
}
return [];
};
/**
* Add events to a timeline
*