You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-26 17:03:12 +03:00
Merge pull request #1225 from matrix-org/bwindels/aliasautocomplete
Add room method for alt_aliases
This commit is contained in:
@@ -861,11 +861,23 @@ Room.prototype.getAliases = function() {
|
|||||||
Room.prototype.getCanonicalAlias = function() {
|
Room.prototype.getCanonicalAlias = function() {
|
||||||
const canonicalAlias = this.currentState.getStateEvents("m.room.canonical_alias", "");
|
const canonicalAlias = this.currentState.getStateEvents("m.room.canonical_alias", "");
|
||||||
if (canonicalAlias) {
|
if (canonicalAlias) {
|
||||||
return canonicalAlias.getContent().alias;
|
return canonicalAlias.getContent().alias || null;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get this room's alternative aliases
|
||||||
|
* @return {array} 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
|
* Add events to a timeline
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user