mirror of
https://github.com/vector-im/element-web.git
synced 2025-11-11 21:51:42 +01:00
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:
parent
08ec6166c7
commit
aa5bdab3ba
@ -144,6 +144,7 @@ export class StopGapWidgetDriver extends WidgetDriver {
|
|||||||
const clientDeviceId = MatrixClientPeg.safeGet().getDeviceId();
|
const clientDeviceId = MatrixClientPeg.safeGet().getDeviceId();
|
||||||
if (clientDeviceId !== null) {
|
if (clientDeviceId !== null) {
|
||||||
// For the session membership type compliant with MSC4143
|
// For the session membership type compliant with MSC4143
|
||||||
|
// Note MSC4143 still uses the org.matrix.msc3401 unstable prefix
|
||||||
this.allowedCapabilities.add(
|
this.allowedCapabilities.add(
|
||||||
WidgetEventCapability.forStateEvent(
|
WidgetEventCapability.forStateEvent(
|
||||||
EventDirection.Send,
|
EventDirection.Send,
|
||||||
@ -151,6 +152,13 @@ export class StopGapWidgetDriver extends WidgetDriver {
|
|||||||
`_${clientUserId}_${clientDeviceId}`,
|
`_${clientUserId}_${clientDeviceId}`,
|
||||||
).raw,
|
).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
|
// Version with no leading underscore, for room versions whose auth rules allow it
|
||||||
this.allowedCapabilities.add(
|
this.allowedCapabilities.add(
|
||||||
WidgetEventCapability.forStateEvent(
|
WidgetEventCapability.forStateEvent(
|
||||||
@ -159,6 +167,13 @@ export class StopGapWidgetDriver extends WidgetDriver {
|
|||||||
`${clientUserId}_${clientDeviceId}`,
|
`${clientUserId}_${clientDeviceId}`,
|
||||||
).raw,
|
).raw,
|
||||||
);
|
);
|
||||||
|
this.allowedCapabilities.add(
|
||||||
|
WidgetEventCapability.forStateEvent(
|
||||||
|
EventDirection.Send,
|
||||||
|
"org.matrix.msc3401.call.member",
|
||||||
|
`${clientUserId}_${clientDeviceId}_m.call`,
|
||||||
|
).raw,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
this.allowedCapabilities.add(
|
this.allowedCapabilities.add(
|
||||||
WidgetEventCapability.forStateEvent(EventDirection.Receive, "org.matrix.msc3401.call.member").raw,
|
WidgetEventCapability.forStateEvent(EventDirection.Receive, "org.matrix.msc3401.call.member").raw,
|
||||||
|
|||||||
@ -110,6 +110,8 @@ describe("StopGapWidgetDriver", () => {
|
|||||||
"org.matrix.msc2762.receive.state_event:org.matrix.msc3401.call.member",
|
"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}`,
|
`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.send.to_device:m.call.invite",
|
||||||
"org.matrix.msc3819.receive.to_device:m.call.invite",
|
"org.matrix.msc3819.receive.to_device:m.call.invite",
|
||||||
"org.matrix.msc3819.send.to_device:m.call.candidates",
|
"org.matrix.msc3819.send.to_device:m.call.candidates",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user