Basic call link join support
This commit is contained in:
parent
2bfb6e7481
commit
96b3413feb
75 changed files with 2438 additions and 509 deletions
31
ts/util/isGroupOrAdhocCall.ts
Normal file
31
ts/util/isGroupOrAdhocCall.ts
Normal file
|
@ -0,0 +1,31 @@
|
|||
// Copyright 2024 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { CallMode } from '../types/Calling';
|
||||
import type { ActiveCallType, ActiveGroupCallType } from '../types/Calling';
|
||||
import type {
|
||||
DirectCallStateType,
|
||||
GroupCallStateType,
|
||||
} from '../state/ducks/calling';
|
||||
|
||||
export function isGroupOrAdhocActiveCall(
|
||||
activeCall: ActiveCallType | undefined
|
||||
): activeCall is ActiveGroupCallType {
|
||||
return Boolean(activeCall && isGroupOrAdhocCallMode(activeCall.callMode));
|
||||
}
|
||||
|
||||
export function isGroupOrAdhocCallMode(
|
||||
callMode: CallMode | undefined | null
|
||||
): callMode is CallMode.Group | CallMode.Adhoc {
|
||||
return callMode === CallMode.Group || callMode === CallMode.Adhoc;
|
||||
}
|
||||
|
||||
export function isGroupOrAdhocCallState(
|
||||
callState: DirectCallStateType | GroupCallStateType | undefined
|
||||
): callState is GroupCallStateType {
|
||||
return Boolean(
|
||||
callState &&
|
||||
(callState.callMode === CallMode.Group ||
|
||||
callState.callMode === CallMode.Adhoc)
|
||||
);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue