More peeking of group calls to prevent out-of-date member info
This commit is contained in:
@@ -372,6 +372,10 @@ const doGroupCallPeek = (
|
||||
return;
|
||||
}
|
||||
|
||||
log.info(
|
||||
`doGroupCallPeek/groupv2(${conversation.groupId}): Found ${peekInfo.deviceCount} devices`
|
||||
);
|
||||
|
||||
await calling.updateCallHistoryForGroupCall(conversationId, peekInfo);
|
||||
|
||||
const formattedPeekInfo = calling.formatGroupCallPeekInfoForRedux(peekInfo);
|
||||
@@ -988,6 +992,23 @@ function peekGroupCallForTheFirstTime(
|
||||
};
|
||||
}
|
||||
|
||||
function peekGroupCallIfItHasMembers(
|
||||
conversationId: string
|
||||
): ThunkAction<void, RootStateType, unknown, PeekGroupCallFulfilledActionType> {
|
||||
return (dispatch, getState) => {
|
||||
const call = getOwn(getState().calling.callsByConversation, conversationId);
|
||||
const shouldPeek =
|
||||
call &&
|
||||
call.callMode === CallMode.Group &&
|
||||
call.joinState === GroupCallJoinState.NotJoined &&
|
||||
call.peekInfo &&
|
||||
call.peekInfo.deviceCount > 0;
|
||||
if (shouldPeek) {
|
||||
doGroupCallPeek(conversationId, dispatch, getState);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
function peekNotConnectedGroupCall(
|
||||
payload: PeekNotConnectedGroupCallType
|
||||
): ThunkAction<void, RootStateType, unknown, PeekGroupCallFulfilledActionType> {
|
||||
@@ -1310,6 +1331,7 @@ export const actions = {
|
||||
openSystemPreferencesAction,
|
||||
outgoingCall,
|
||||
peekGroupCallForTheFirstTime,
|
||||
peekGroupCallIfItHasMembers,
|
||||
peekNotConnectedGroupCall,
|
||||
receiveIncomingDirectCall,
|
||||
receiveIncomingGroupCall,
|
||||
|
Reference in New Issue
Block a user