2023-10-16 17:58:51 +00:00
|
|
|
// Copyright 2023 Signal Messenger, LLC
|
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
2024-08-06 19:29:13 +00:00
|
|
|
import { CallState, GroupCallConnectionState } from '../types/Calling';
|
|
|
|
import { CallMode } from '../types/CallDisposition';
|
2023-10-16 17:58:51 +00:00
|
|
|
import type { ActiveCallType } from '../types/Calling';
|
2024-07-02 15:03:02 +00:00
|
|
|
import { isGroupOrAdhocActiveCall } from './isGroupOrAdhocCall';
|
2023-10-16 17:58:51 +00:00
|
|
|
|
|
|
|
export function isReconnecting(activeCall: ActiveCallType): boolean {
|
|
|
|
return (
|
2024-07-02 15:03:02 +00:00
|
|
|
(isGroupOrAdhocActiveCall(activeCall) &&
|
2023-10-16 17:58:51 +00:00
|
|
|
activeCall.connectionState === GroupCallConnectionState.Reconnecting) ||
|
|
|
|
(activeCall.callMode === CallMode.Direct &&
|
|
|
|
activeCall.callState === CallState.Reconnecting)
|
|
|
|
);
|
|
|
|
}
|