Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 119c14c

Browse files
committed
Forbid redaction of encryption events
Redacting m.room.encryption events will leave the room in a broken state, and so we shouldn't allow the user to do this. Signed-off-by: Robin Townsend <[email protected]>
1 parent 04d566e commit 119c14c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/components/views/context_menus/MessageContextMenu.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,10 @@ export default class MessageContextMenu extends React.Component {
7878

7979
// We explicitly decline to show the redact option on ACL events as it has a potential
8080
// to obliterate the room - https://github.com/matrix-org/synapse/issues/4042
81+
// Similarly for encryption events, since redacting them "breaks everything"
8182
const canRedact = room.currentState.maySendRedactionForEvent(this.props.mxEvent, cli.credentials.userId)
82-
&& this.props.mxEvent.getType() !== EventType.RoomServerAcl;
83+
&& this.props.mxEvent.getType() !== EventType.RoomServerAcl
84+
&& this.props.mxEvent.getType() !== EventType.RoomEncryption;
8385
let canPin = room.currentState.mayClientSendStateEvent('m.room.pinned_events', cli);
8486

8587
// HACK: Intentionally say we can't pin if the user doesn't want to use the functionality

0 commit comments

Comments
 (0)