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

Commit c2ae6c2

Browse files
authored
Merge pull request #5991 from robintown/forbid-encryption-redaction
Forbid redaction of encryption events
2 parents 04d566e + 119c14c commit c2ae6c2

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)