Element Call widget driver: allow state keys to have a _m.call suffix (#30566)

* Extended string-packing for state keys allowing additonially the `_m.call` suffix

* add comment about unstable prefix
This commit is contained in:
fkwp 2025-08-15 21:19:28 +02:00 committed by GitHub
parent 08ec6166c7
commit aa5bdab3ba
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 17 additions and 0 deletions

View File

@ -144,6 +144,7 @@ export class StopGapWidgetDriver extends WidgetDriver {
const clientDeviceId = MatrixClientPeg.safeGet().getDeviceId();
if (clientDeviceId !== null) {
// For the session membership type compliant with MSC4143
// Note MSC4143 still uses the org.matrix.msc3401 unstable prefix
this.allowedCapabilities.add(
WidgetEventCapability.forStateEvent(
EventDirection.Send,
@ -151,6 +152,13 @@ export class StopGapWidgetDriver extends WidgetDriver {
`_${clientUserId}_${clientDeviceId}`,
).raw,
);
this.allowedCapabilities.add(
WidgetEventCapability.forStateEvent(
EventDirection.Send,
"org.matrix.msc3401.call.member",
`_${clientUserId}_${clientDeviceId}_m.call`,
).raw,
);
// Version with no leading underscore, for room versions whose auth rules allow it
this.allowedCapabilities.add(
WidgetEventCapability.forStateEvent(
@ -159,6 +167,13 @@ export class StopGapWidgetDriver extends WidgetDriver {
`${clientUserId}_${clientDeviceId}`,
).raw,
);
this.allowedCapabilities.add(
WidgetEventCapability.forStateEvent(
EventDirection.Send,
"org.matrix.msc3401.call.member",
`${clientUserId}_${clientDeviceId}_m.call`,
).raw,
);
}
this.allowedCapabilities.add(
WidgetEventCapability.forStateEvent(EventDirection.Receive, "org.matrix.msc3401.call.member").raw,

View File

@ -110,6 +110,8 @@ describe("StopGapWidgetDriver", () => {
"org.matrix.msc2762.receive.state_event:org.matrix.msc3401.call.member",
`org.matrix.msc2762.send.state_event:org.matrix.msc3401.call.member#_@alice:example.org_${client.deviceId}`,
`org.matrix.msc2762.send.state_event:org.matrix.msc3401.call.member#@alice:example.org_${client.deviceId}`,
`org.matrix.msc2762.send.state_event:org.matrix.msc3401.call.member#_@alice:example.org_${client.deviceId}_m.call`,
`org.matrix.msc2762.send.state_event:org.matrix.msc3401.call.member#@alice:example.org_${client.deviceId}_m.call`,
"org.matrix.msc3819.send.to_device:m.call.invite",
"org.matrix.msc3819.receive.to_device:m.call.invite",
"org.matrix.msc3819.send.to_device:m.call.candidates",