From: ajbura Date: Sat, 5 Feb 2022 13:29:44 +0000 (+0530) Subject: Show tombstone message in tombstoned room (#195) X-Git-Tag: v1.8.0~101 X-Git-Url: https://git.wafflesoft.org/?a=commitdiff_plain;h=a9692f7db46836729bd144b556db378228dc503d;p=rainny.git Show tombstone message in tombstoned room (#195) Signed-off-by: ajbura --- diff --git a/src/app/organisms/room/RoomViewInput.jsx b/src/app/organisms/room/RoomViewInput.jsx index d574d86..37e0298 100644 --- a/src/app/organisms/room/RoomViewInput.jsx +++ b/src/app/organisms/room/RoomViewInput.jsx @@ -303,12 +303,18 @@ function RoomViewInput({ if (file !== null) roomsInput.setAttachment(roomId, file); } - const canISend = roomTimeline.room.currentState.maySendMessage(mx.getUserId()); - function renderInputs() { - if (!canISend) { + const canISend = roomTimeline.room.currentState.maySendMessage(mx.getUserId()); + const tombstoneEvent = roomTimeline.room.currentState.getStateEvents('m.room.tombstone')[0]; + if (!canISend || tombstoneEvent) { return ( - You do not have permission to post to this room + + { + tombstoneEvent + ? tombstoneEvent.getContent()?.body ?? 'This room has been replaced and is no longer active.' + : 'You do not have permission to post to this room' + } + ); } return (