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,9 +106,13 @@ class Room extends ElemJS {
|
|||
}
|
||||
// if the room has no alias, use the names of its members ("heroes")
|
||||
const users = this.data.summary["m.heroes"]
|
||||
if (users && users.length) {
|
||||
const usernames = users.map(u => (u.match(/^@([^:]+):/) || [])[1] || u)
|
||||
return usernames.join(", ")
|
||||
}
|
||||
// the room is empty
|
||||
return "Empty room"
|
||||
}
|
||||
|
||||
getIcon() {
|
||||
const avatar = this.data.state.events.find(e => e.type === "m.room.avatar")
|
||||
|
|
Loading…
Reference in a new issue