add roomDescription property

This commit is contained in:
Bruno Windels 2021-04-27 14:42:37 +02:00
parent b6573258fb
commit f902f255a4

View file

@ -33,6 +33,7 @@ export class InviteViewModel extends ViewModel {
if (this._invite.inviter) { if (this._invite.inviter) {
this._inviter = new RoomMemberViewModel(this._invite.inviter, mediaRepository, this.platform); this._inviter = new RoomMemberViewModel(this._invite.inviter, mediaRepository, this.platform);
} }
this._roomDescription = this._createRoomDescription();
} }
get kind() { return "invite"; } get kind() { return "invite"; }
@ -67,6 +68,24 @@ export class InviteViewModel extends ViewModel {
return null; return null;
} }
_createRoomDescription() {
const parts = [];
if (this._invite.isPublic) {
parts.push("Public room");
} else {
parts.push("Private room");
}
if (this._invite.canonicalAlias) {
parts.push(this._invite.canonicalAlias);
}
return parts.join(" • ")
}
get roomDescription() {
return this._roomDescription;
}
get avatarTitle() { get avatarTitle() {
return this.name; return this.name;
} }