Skip to content

Commit a23a2c0

Browse files
authored
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.
1 parent c2c040d commit a23a2c0

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/stores/widgets/StopGapWidgetDriver.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,17 +168,18 @@ export class StopGapWidgetDriver extends WidgetDriver {
168168
WidgetEventCapability.forStateEvent(EventDirection.Receive, EventType.RoomCreate).raw,
169169
);
170170

171+
const sendRoomEvents = [EventType.CallNotify, EventType.RTCNotification];
171172
const sendRecvRoomEvents = [
172173
"io.element.call.encryption_keys",
173174
"org.matrix.rageshake_request",
174175
EventType.Reaction,
175176
EventType.RoomRedaction,
176177
"io.element.call.reaction",
177178
];
178-
for (const eventType of sendRecvRoomEvents) {
179+
for (const eventType of [...sendRoomEvents, ...sendRecvRoomEvents])
179180
this.allowedCapabilities.add(WidgetEventCapability.forRoomEvent(EventDirection.Send, eventType).raw);
181+
for (const eventType of sendRecvRoomEvents)
180182
this.allowedCapabilities.add(WidgetEventCapability.forRoomEvent(EventDirection.Receive, eventType).raw);
181-
}
182183

183184
const sendRecvToDevice = [
184185
EventType.CallInvite,

test/unit-tests/stores/widgets/StopGapWidgetDriver-test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,16 @@ describe("StopGapWidgetDriver", () => {
9292
"m.always_on_screen",
9393
"town.robin.msc3846.turn_servers",
9494
"org.matrix.msc2762.timeline:!1:example.org",
95+
"org.matrix.msc2762.send.event:org.matrix.msc4075.call.notify",
96+
"org.matrix.msc2762.send.event:org.matrix.msc4075.rtc.notification",
9597
"org.matrix.msc2762.send.event:org.matrix.rageshake_request",
9698
"org.matrix.msc2762.receive.event:org.matrix.rageshake_request",
9799
"org.matrix.msc2762.send.event:m.reaction",
98100
"org.matrix.msc2762.receive.event:m.reaction",
99101
"org.matrix.msc2762.send.event:m.room.redaction",
100102
"org.matrix.msc2762.receive.event:m.room.redaction",
103+
"org.matrix.msc2762.send.event:io.element.call.reaction",
104+
"org.matrix.msc2762.receive.event:io.element.call.reaction",
101105
"org.matrix.msc2762.receive.state_event:m.room.create",
102106
"org.matrix.msc2762.receive.state_event:m.room.name",
103107
"org.matrix.msc2762.receive.state_event:m.room.member",

0 commit comments

Comments
 (0)