moveCall method

void moveCall({
  1. required ChatId chatId,
  2. required ChatId newChatId,
  3. required ChatItemId callId,
  4. required ChatItemId newCallId,
})

Switches an OngoingCall identified by its chatId to the specified newChatId.

Implementation

void moveCall({
  required ChatId chatId,
  required ChatId newChatId,
  required ChatItemId callId,
  required ChatItemId newCallId,
}) {
  Log.debug(
    'moveCall($chatId, $newChatId, $callId, $newCallId)',
    '$runtimeType',
  );

  final Rx<OngoingCall>? call = _callsRepo[chatId];
  if (call != null) {
    _callsRepo.move(chatId, newChatId);
    _callsRepo.moveCredentials(callId, newCallId, chatId, newChatId);
    if (WebUtils.isPopup) {
      WebUtils.moveCall(chatId, newChatId, newState: call.value.toStored());
    }
  }
}