Skip to content

Commit

Permalink
Merge pull request #968 from matrix-org/jryans/reactions-disable-encr…
Browse files Browse the repository at this point in the history
…yption

Disable event encryption for reactions
  • Loading branch information
jryans authored Jun 26, 2019
2 parents ecca8bc + 59c4e2c commit 4ec4d33
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -1863,6 +1863,20 @@ function _encryptEventIfNeeded(client, event, room) {
return null;
}

if (event.getType() === "m.reaction") {
// For reactions, there is a very little gained by encrypting the entire
// event, as relation data is already kept in the clear. Event
// encryption for a reaction effectively only obscures the event type,
// but the purpose is still obvious from the relation data, so nothing
// is really gained. It also causes quite a few problems, such as:
// * triggers notifications via default push rules
// * prevents server-side bundling for reactions
// The reaction key / content / emoji value does warrant encrypting, but
// this will be handled separately by encrypting just this value.
// See https://github.com/matrix-org/matrix-doc/pull/1849#pullrequestreview-248763642
return null;
}

if (!client._crypto) {
throw new Error(
"This room is configured to use encryption, but your client does " +
Expand Down

0 comments on commit 4ec4d33

Please sign in to comment.