Call Disposition

This commit is contained in:
Jamie Kyle 2023-01-09 16:52:01 -08:00 committed by GitHub
parent 9927b132b9
commit e5638c0b20
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 445 additions and 53 deletions

View file

@ -224,8 +224,10 @@ export function IncomingCallBar(props: PropsType): JSX.Element | null {
}, [bounceAppIconStart, bounceAppIconStop]);
const acceptVideoCall = useCallback(() => {
acceptCall({ conversationId, asVideoCall: true });
}, [acceptCall, conversationId]);
if (isVideoCall) {
acceptCall({ conversationId, asVideoCall: true });
}
}, [isVideoCall, acceptCall, conversationId]);
const acceptAudioCall = useCallback(() => {
acceptCall({ conversationId, asVideoCall: false });

View file

@ -205,11 +205,11 @@ const CALLING_SHORTCUTS: Array<ShortcutType> = [
keys: [['shift', 'V']],
},
{
description: 'Keyboard--accept-video-call',
description: 'icu:Keyboard--accept-video-call',
keys: [['ctrlOrAlt', 'shift', 'V']],
},
{
description: 'Keyboard--accept-audio-call',
description: 'icu:Keyboard--accept-call-without-video',
keys: [['ctrlOrAlt', 'shift', 'A']],
},
{

View file

@ -18,6 +18,7 @@ import {
import { missingCaseError } from '../../util/missingCaseError';
import { Tooltip, TooltipPlacement } from '../Tooltip';
import * as log from '../../logging/log';
import { assertDev } from '../../util/assert';
export type PropsActionsType = {
returnToActiveCall: () => void;
@ -42,11 +43,14 @@ export const CallingNotification: React.FC<PropsType> = React.memo(
let timestamp: number;
let wasMissed = false;
switch (props.callMode) {
case CallMode.Direct:
timestamp = props.acceptedTime || props.endedTime;
case CallMode.Direct: {
const resolvedTime = props.acceptedTime ?? props.endedTime;
assertDev(resolvedTime, 'Direct call must have accepted or ended time');
timestamp = resolvedTime;
wasMissed =
props.wasIncoming && !props.acceptedTime && !props.wasDeclined;
break;
}
case CallMode.Group:
timestamp = props.startedTime;
break;