onCallCandidates method

Future<void> onCallCandidates(
  1. String roomId,
  2. String senderId,
  3. Map<String, dynamic> content
)

Implementation

Future<void> onCallCandidates(
    String roomId, String senderId, Map<String, dynamic> content) async {
  if (senderId == client.userID) {
    // Ignore messages to yourself.
    return;
  }
  Logs().v('[VOIP] onCallCandidates => ${content.toString()}');
  final String callId = content['call_id'];
  final call = calls[callId];
  if (call != null) {
    if (call.room.id != roomId) {
      Logs().w(
          'Ignoring call candidates for room $roomId claiming to be for call in room ${call.room.id}');
      return;
    }
    await call.onCandidatesReceived(content['candidates']);
  } else {
    Logs().v('[VOIP] onCallCandidates: Session [$callId] not found!');
  }
}