You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-23 17:02:25 +03:00
@@ -80,7 +80,7 @@ export class CallEventHandler {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
await this.handleCallEvent(e);
|
this.handleCallEvent(e);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
logger.error("Caught exception handling call event", e);
|
logger.error("Caught exception handling call event", e);
|
||||||
}
|
}
|
||||||
@@ -100,7 +100,7 @@ export class CallEventHandler {
|
|||||||
|
|
||||||
if (event.isBeingDecrypted() || event.isDecryptionFailure()) {
|
if (event.isBeingDecrypted() || event.isDecryptionFailure()) {
|
||||||
// add an event listener for once the event is decrypted.
|
// add an event listener for once the event is decrypted.
|
||||||
event.once("Event.decrypted", async () => {
|
event.once("Event.decrypted", () => {
|
||||||
if (!this.eventIsACall(event)) return;
|
if (!this.eventIsACall(event)) return;
|
||||||
|
|
||||||
if (this.callEventBuffer.includes(event)) {
|
if (this.callEventBuffer.includes(event)) {
|
||||||
@@ -110,7 +110,7 @@ export class CallEventHandler {
|
|||||||
// This one wasn't buffered so just run the event handler for it
|
// This one wasn't buffered so just run the event handler for it
|
||||||
// straight away
|
// straight away
|
||||||
try {
|
try {
|
||||||
await this.handleCallEvent(event);
|
this.handleCallEvent(event);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
logger.error("Caught exception handling call event", e);
|
logger.error("Caught exception handling call event", e);
|
||||||
}
|
}
|
||||||
@@ -169,7 +169,7 @@ export class CallEventHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
call.callId = content.call_id;
|
call.callId = content.call_id;
|
||||||
await call.initWithInvite(event);
|
const initWithInvitePromise = call.initWithInvite(event);
|
||||||
this.calls.set(call.callId, call);
|
this.calls.set(call.callId, call);
|
||||||
|
|
||||||
// if we stashed candidate events for that call ID, play them back now
|
// if we stashed candidate events for that call ID, play them back now
|
||||||
@@ -210,6 +210,8 @@ export class CallEventHandler {
|
|||||||
"Glare detected: answering incoming call " + call.callId +
|
"Glare detected: answering incoming call " + call.callId +
|
||||||
" and canceling outgoing call " + existingCall.callId,
|
" and canceling outgoing call " + existingCall.callId,
|
||||||
);
|
);
|
||||||
|
// Await init with invite as we need a peerConn for the following methods
|
||||||
|
await initWithInvitePromise;
|
||||||
existingCall.replacedBy(call);
|
existingCall.replacedBy(call);
|
||||||
call.answer();
|
call.answer();
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user