Show tombstone message in tombstoned room (#195)
Signed-off-by: ajbura <ajbura@gmail.com>
This commit is contained in:
parent
d05a426d00
commit
a9692f7db4
1 changed files with 10 additions and 4 deletions
|
@ -303,12 +303,18 @@ function RoomViewInput({
|
||||||
if (file !== null) roomsInput.setAttachment(roomId, file);
|
if (file !== null) roomsInput.setAttachment(roomId, file);
|
||||||
}
|
}
|
||||||
|
|
||||||
const canISend = roomTimeline.room.currentState.maySendMessage(mx.getUserId());
|
|
||||||
|
|
||||||
function renderInputs() {
|
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 (
|
return (
|
||||||
<Text className="room-input__alert">You do not have permission to post to this room</Text>
|
<Text className="room-input__alert">
|
||||||
|
{
|
||||||
|
tombstoneEvent
|
||||||
|
? tombstoneEvent.getContent()?.body ?? 'This room has been replaced and is no longer active.'
|
||||||
|
: 'You do not have permission to post to this room'
|
||||||
|
}
|
||||||
|
</Text>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
|
|
Loading…
Reference in a new issue