1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-12-01 04:43:29 +03:00

Fix temporary call messages being handled without call

In cases where a rogue client, or just a simple bug, sends a temporary
call message, like CallNegotiate the messages should just be discarded
if there's no actual p2p connection created.
This commit is contained in:
Dariusz Niemczyk
2021-08-09 12:43:00 +02:00
parent 946dcd0301
commit 9fe05e7d40
2 changed files with 13 additions and 3 deletions

View File

@@ -1286,7 +1286,7 @@ export class MatrixCall extends EventEmitter {
// https://developer.mozilla.org/en-US/docs/Web/API/WebRTC_API/Perfect_negotiation
const offerCollision = (
(description.type === 'offer') &&
(this.makingOffer || this.peerConn.signalingState != 'stable')
(this.makingOffer || this.peerConn.signalingState !== 'stable')
);
this.ignoreOffer = !polite && offerCollision;
@@ -1935,6 +1935,10 @@ export class MatrixCall extends EventEmitter {
}
}
}
get hasPeerConnection() {
return Boolean(this.peerConn);
}
}
async function getScreensharingStream(