Fallback to room name "empty room"
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
9e71336c5b
commit
e18c8c77ae
1 changed files with 6 additions and 2 deletions
|
@ -106,8 +106,12 @@ class Room extends ElemJS {
|
||||||
}
|
}
|
||||||
// if the room has no alias, use the names of its members ("heroes")
|
// if the room has no alias, use the names of its members ("heroes")
|
||||||
const users = this.data.summary["m.heroes"]
|
const users = this.data.summary["m.heroes"]
|
||||||
const usernames = users.map(u => (u.match(/^@([^:]+):/) || [])[1] || u)
|
if (users && users.length) {
|
||||||
return usernames.join(", ")
|
const usernames = users.map(u => (u.match(/^@([^:]+):/) || [])[1] || u)
|
||||||
|
return usernames.join(", ")
|
||||||
|
}
|
||||||
|
// the room is empty
|
||||||
|
return "Empty room"
|
||||||
}
|
}
|
||||||
|
|
||||||
getIcon() {
|
getIcon() {
|
||||||
|
|
Loading…
Reference in a new issue