Skip to content

Commit

Permalink
Define power levels to disable calls/reactions/redaction/stickers in …
Browse files Browse the repository at this point in the history
…PMs initiated from IRC (#1663)

* Patch a number of packages

* changelog

* Ensure tests work for upgrades

* Fix tests properly

* 0.26.1

* Update node-irc to 1.2.1 and bump version to 0.34.0

* Define power levels to disable calls/reactions/redaction/stickers in PM

No one but the sender can see them because we cannot bridge them.
Blocking them with PLs allows the clients to hide these features
from their UI, so users do not mistakenly believe they will be received.

* Block redactions, more call event types, and widgets

---------

Co-authored-by: Will Hunt <willh@matrix.org>
Co-authored-by: Tadeusz Sośnierz <tadeusz@sosnierz.com>
Co-authored-by: Half-Shot <will@half-shot.uk>
  • Loading branch information
4 people authored May 2, 2023
1 parent 09e2c96 commit 6ce85b3
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 3 deletions.
2 changes: 2 additions & 0 deletions changelog.d/1663.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- New PM rooms are configured to disable calls, reactions, redactions, and stickers;
as they could not be bridged anyway.
14 changes: 12 additions & 2 deletions spec/integ/pm.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,9 +284,19 @@ describe("IRC-to-Matrix PMing", () => {
"m.room.canonical_alias": 100,
"m.room.history_visibility": 100,
"m.room.power_levels": 100,
"m.room.encryption": 100
"m.room.encryption": 100,
"org.matrix.msc3401.call": 100,
"org.matrix.msc3401.call.member": 100,
"im.vector.modular.widgets": 100,
"io.element.voice_broadcast_info": 100,
"m.call.invite": 100,
"m.call.candidate": 100,
"m.reaction": 100,
"m.room.redaction": 100,
"m.sticker": 100,
},
invite: 100
invite: 100,
redact: 100,
},
}]);
resolve();
Expand Down
15 changes: 14 additions & 1 deletion src/bridge/IrcHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,22 @@ export class IrcHandler {
"m.room.canonical_alias": 100,
"m.room.history_visibility": 100,
"m.room.power_levels": 100,
"m.room.encryption": 100
"m.room.encryption": 100,
// Event types that we cannot translate to IRC;
// we might as well block them with PLs so
// Matrix clients can hide them from their UI.
"m.call.invite": 100,
"m.call.candidate": 100,
"org.matrix.msc3401.call": 100,
"org.matrix.msc3401.call.member": 100,
"im.vector.modular.widgets": 100,
"io.element.voice_broadcast_info": 100,
"m.reaction": 100,
"m.room.redaction": 100,
"m.sticker": 100,
},
invite: 100,
redact: 100,
},
type: "m.room.power_levels",
state_key: "",
Expand Down

0 comments on commit 6ce85b3

Please sign in to comment.