onLeftParticipant method

  1. @override
Future<void> onLeftParticipant(
  1. GroupCallSession groupCall,
  2. List<CallParticipant> anyLeft
)
override

Implementation

@override
Future<void> onLeftParticipant(
  GroupCallSession groupCall,
  List<CallParticipant> anyLeft,
) async {
  _encryptionKeysMap.removeWhere((key, value) => anyLeft.contains(key));

  // debounce it because people leave at the same time
  if (_memberLeaveEncKeyRotateDebounceTimer != null) {
    _memberLeaveEncKeyRotateDebounceTimer!.cancel();
  }
  _memberLeaveEncKeyRotateDebounceTimer =
      Timer(CallTimeouts.makeKeyDelay, () async {
    await _makeNewSenderKey(groupCall, true);
  });
}