Fix pills for CIDER too

This commit is contained in:
Travis Ralston
2019-09-30 20:37:24 -06:00
parent 2824f468d9
commit ce0a534db1
6 changed files with 27 additions and 7 deletions

View File

@@ -48,6 +48,16 @@ export default class RiotPermalinkConstructor extends PermalinkConstructor {
return `${this._riotUrl}/#/group/${groupId}`;
}
forEntity(entityId: string): string {
if (entityId[0] === '!' || entityId[0] === '#') {
return this.forRoom(entityId);
} else if (entityId[0] === '@') {
return this.forUser(entityId);
} else if (entityId[0] === '+') {
return this.forGroup(entityId);
} else throw new Error("Unrecognized entity");
}
isPermalinkHost(testHost: string): boolean {
const parsedUrl = new URL(this._riotUrl);
return testHost === (parsedUrl.host || parsedUrl.hostname); // one of the hosts should match