Fix adding group call history with no ring
This commit is contained in:
parent
da05b32f4f
commit
d3a18a197b
3 changed files with 13 additions and 12 deletions
|
@ -2261,7 +2261,7 @@ export class CallingClass {
|
|||
|
||||
public async updateCallHistoryForGroupCall(
|
||||
conversationId: string,
|
||||
joinState: GroupCallJoinState,
|
||||
joinState: GroupCallJoinState | null,
|
||||
peekInfo: PeekInfo | null
|
||||
): Promise<void> {
|
||||
const groupCallMeta = getGroupCallMeta(peekInfo);
|
||||
|
|
|
@ -372,13 +372,14 @@ const doGroupCallPeek = (
|
|||
`doGroupCallPeek/groupv2(${conversation.groupId}): Found ${peekInfo.deviceCount} devices`
|
||||
);
|
||||
|
||||
if (existingCall?.callMode === CallMode.Group) {
|
||||
await calling.updateCallHistoryForGroupCall(
|
||||
conversationId,
|
||||
existingCall.joinState,
|
||||
peekInfo
|
||||
);
|
||||
}
|
||||
const joinState =
|
||||
existingCall?.callMode === CallMode.Group ? existingCall.joinState : null;
|
||||
|
||||
await calling.updateCallHistoryForGroupCall(
|
||||
conversationId,
|
||||
joinState,
|
||||
peekInfo
|
||||
);
|
||||
|
||||
const formattedPeekInfo = calling.formatGroupCallPeekInfoForRedux(peekInfo);
|
||||
|
||||
|
|
|
@ -352,20 +352,20 @@ export function getLocalCallEventFromRingUpdate(
|
|||
}
|
||||
|
||||
export function getLocalCallEventFromJoinState(
|
||||
joinState: GroupCallJoinState,
|
||||
joinState: GroupCallJoinState | null,
|
||||
groupCallMeta: GroupCallMeta
|
||||
): LocalCallEvent | null {
|
||||
const direction = getCallDirectionFromRingerId(groupCallMeta.ringerId);
|
||||
log.info(
|
||||
'getLocalCallEventFromGroupCall',
|
||||
direction,
|
||||
GroupCallJoinState[joinState]
|
||||
joinState != null ? GroupCallJoinState[joinState] : null
|
||||
);
|
||||
if (direction === CallDirection.Incoming) {
|
||||
if (joinState === GroupCallJoinState.Joined) {
|
||||
return LocalCallEvent.Accepted;
|
||||
}
|
||||
if (joinState === GroupCallJoinState.NotJoined) {
|
||||
if (joinState === GroupCallJoinState.NotJoined || joinState == null) {
|
||||
return LocalCallEvent.Started;
|
||||
}
|
||||
if (
|
||||
|
@ -376,7 +376,7 @@ export function getLocalCallEventFromJoinState(
|
|||
}
|
||||
throw missingCaseError(joinState);
|
||||
} else {
|
||||
if (joinState === GroupCallJoinState.NotJoined) {
|
||||
if (joinState === GroupCallJoinState.NotJoined || joinState == null) {
|
||||
return LocalCallEvent.Started;
|
||||
}
|
||||
return LocalCallEvent.Ringing;
|
||||
|
|
Loading…
Reference in a new issue