From a23a2c03d3a4fd9bf0b4cc3b57d49053ff9a8a1e Mon Sep 17 00:00:00 2001 From: Robin Date: Sun, 27 Jul 2025 15:37:10 +0200 Subject: [PATCH] Allow Element Call to send call notifications (#30404) * Allow Element Call to send call notifications Currently Element Web is responsible for sending the call notification event, but this is planned to be changed soon. As of the upcoming Element Call 0.14.0 release, it will request the capability to send call notifications itself, and we should auto-approve this capability. * Add reaction capability missing from test Element Call does in fact request this one. --- src/stores/widgets/StopGapWidgetDriver.ts | 5 +++-- test/unit-tests/stores/widgets/StopGapWidgetDriver-test.ts | 4 ++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/stores/widgets/StopGapWidgetDriver.ts b/src/stores/widgets/StopGapWidgetDriver.ts index 282d6f5d92..d47c9d18e4 100644 --- a/src/stores/widgets/StopGapWidgetDriver.ts +++ b/src/stores/widgets/StopGapWidgetDriver.ts @@ -168,6 +168,7 @@ export class StopGapWidgetDriver extends WidgetDriver { WidgetEventCapability.forStateEvent(EventDirection.Receive, EventType.RoomCreate).raw, ); + const sendRoomEvents = [EventType.CallNotify, EventType.RTCNotification]; const sendRecvRoomEvents = [ "io.element.call.encryption_keys", "org.matrix.rageshake_request", @@ -175,10 +176,10 @@ export class StopGapWidgetDriver extends WidgetDriver { EventType.RoomRedaction, "io.element.call.reaction", ]; - for (const eventType of sendRecvRoomEvents) { + for (const eventType of [...sendRoomEvents, ...sendRecvRoomEvents]) this.allowedCapabilities.add(WidgetEventCapability.forRoomEvent(EventDirection.Send, eventType).raw); + for (const eventType of sendRecvRoomEvents) this.allowedCapabilities.add(WidgetEventCapability.forRoomEvent(EventDirection.Receive, eventType).raw); - } const sendRecvToDevice = [ EventType.CallInvite, diff --git a/test/unit-tests/stores/widgets/StopGapWidgetDriver-test.ts b/test/unit-tests/stores/widgets/StopGapWidgetDriver-test.ts index 1b646498bb..ec352f28d0 100644 --- a/test/unit-tests/stores/widgets/StopGapWidgetDriver-test.ts +++ b/test/unit-tests/stores/widgets/StopGapWidgetDriver-test.ts @@ -92,12 +92,16 @@ describe("StopGapWidgetDriver", () => { "m.always_on_screen", "town.robin.msc3846.turn_servers", "org.matrix.msc2762.timeline:!1:example.org", + "org.matrix.msc2762.send.event:org.matrix.msc4075.call.notify", + "org.matrix.msc2762.send.event:org.matrix.msc4075.rtc.notification", "org.matrix.msc2762.send.event:org.matrix.rageshake_request", "org.matrix.msc2762.receive.event:org.matrix.rageshake_request", "org.matrix.msc2762.send.event:m.reaction", "org.matrix.msc2762.receive.event:m.reaction", "org.matrix.msc2762.send.event:m.room.redaction", "org.matrix.msc2762.receive.event:m.room.redaction", + "org.matrix.msc2762.send.event:io.element.call.reaction", + "org.matrix.msc2762.receive.event:io.element.call.reaction", "org.matrix.msc2762.receive.state_event:m.room.create", "org.matrix.msc2762.receive.state_event:m.room.name", "org.matrix.msc2762.receive.state_event:m.room.member",