1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-25 05:23:13 +03:00

Support MSC3086 asserted identity

This commit is contained in:
David Baker
2021-04-19 20:28:42 +01:00
parent cbe9b59222
commit c0af2f25a1
3 changed files with 41 additions and 1 deletions

View File

@@ -87,7 +87,11 @@ export class CallEventHandler {
private onEvent = (event: MatrixEvent) => {
// any call events or ones that might be once they're decrypted
if (event.getType().indexOf("m.call.") === 0 || event.isBeingDecrypted()) {
if (
event.getType().indexOf("m.call.") === 0 ||
event.getType().indexOf("org.matrix.call.") === 0
|| event.isBeingDecrypted()
) {
// queue up for processing once all events from this sync have been
// processed (see above).
this.callEventBuffer.push(event);
@@ -271,6 +275,17 @@ export class CallEventHandler {
}
call.onNegotiateReceived(event);
} else if (
event.getType() === EventType.CallAssertedIdentity || event.getType() === EventType.CallAssertedIdentityPrefix
) {
if (!call) return;
if (event.getContent().party_id === call.ourPartyId) {
// Ignore remote echo (not that we send asserted identity, but still...)
return;
}
call.onAssertedIdentityReceived(event);
}
}
}