Merge pull request #5654 from matrix-org/dbkr/prepare_to_encrypt_on_incoming_call

Prepare to encrypt when a call arrives
pull/21833/head
David Baker 2021-02-16 15:07:32 +00:00 committed by GitHub
commit 7260a4c248
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -681,6 +681,12 @@ export default class CallHandler {
Analytics.trackEvent('voip', 'receiveCall', 'type', call.type);
this.calls.set(mappedRoomId, call)
this.setCallListeners(call);
// get ready to send encrypted events in the room, so if the user does answer
// the call, we'll be ready to send. NB. This is the protocol-level room ID not
// the mapped one: that's where we'll send the events.
const cli = MatrixClientPeg.get();
cli.prepareToEncrypt(cli.getRoom(call.roomId));
}
break;
case 'hangup':