From f902f255a42f596d9a6cefab06ce00093437df33 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Tue, 27 Apr 2021 14:42:37 +0200 Subject: [PATCH] add roomDescription property --- src/domain/session/room/InviteViewModel.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/domain/session/room/InviteViewModel.js b/src/domain/session/room/InviteViewModel.js index fe629dc4..377c7ab5 100644 --- a/src/domain/session/room/InviteViewModel.js +++ b/src/domain/session/room/InviteViewModel.js @@ -33,6 +33,7 @@ export class InviteViewModel extends ViewModel { if (this._invite.inviter) { this._inviter = new RoomMemberViewModel(this._invite.inviter, mediaRepository, this.platform); } + this._roomDescription = this._createRoomDescription(); } get kind() { return "invite"; } @@ -67,6 +68,24 @@ export class InviteViewModel extends ViewModel { 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() { return this.name; }