You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-26 17:03:12 +03:00
Abort if call has ended and remove stray self(!)
This commit is contained in:
@@ -942,6 +942,10 @@ export class MatrixCall extends EventEmitter {
|
||||
setTimeout(resolve, 200);
|
||||
});
|
||||
|
||||
// @ts-ignore: Typescript thinks this is impossible because of the
|
||||
// check above: it has not heard of async functions
|
||||
if (this.state === CallState.Ended) return;
|
||||
|
||||
const content = {
|
||||
// OpenWebRTC appears to add extra stuff (like the DTLS fingerprint)
|
||||
// to the description when setting it on the peerconnection.
|
||||
@@ -1244,7 +1248,7 @@ export class MatrixCall extends EventEmitter {
|
||||
this.peerConn.close();
|
||||
}
|
||||
if (shouldEmit) {
|
||||
this.emit(CallEvent.Hangup, self);
|
||||
this.emit(CallEvent.Hangup, this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user