Update call strings
This commit is contained in:
parent
a634792be7
commit
26140ee3d6
7 changed files with 289 additions and 53 deletions
|
@ -758,14 +758,18 @@ export function CallsList({
|
|||
item.direction === CallDirection.Incoming &&
|
||||
(item.status === DirectCallStatus.Missed ||
|
||||
item.status === GroupCallStatus.Missed);
|
||||
const wasDeclined =
|
||||
item.direction === CallDirection.Incoming &&
|
||||
(item.status === DirectCallStatus.Declined ||
|
||||
item.status === GroupCallStatus.Declined);
|
||||
|
||||
let statusText;
|
||||
if (wasMissed) {
|
||||
statusText = i18n('icu:CallsList__ItemCallInfo--Missed');
|
||||
} else if (wasDeclined) {
|
||||
statusText = i18n('icu:CallsList__ItemCallInfo--Declined');
|
||||
} else if (isAdhoc) {
|
||||
statusText = i18n('icu:CallsList__ItemCallInfo--CallLink');
|
||||
} else if (item.type === CallType.Group) {
|
||||
statusText = i18n('icu:CallsList__ItemCallInfo--GroupCall');
|
||||
} else if (item.direction === CallDirection.Outgoing) {
|
||||
statusText = i18n('icu:CallsList__ItemCallInfo--Outgoing');
|
||||
} else if (item.direction === CallDirection.Incoming) {
|
||||
|
@ -819,6 +823,7 @@ export function CallsList({
|
|||
className={classNames('CallsList__Item', {
|
||||
'CallsList__Item--selected': isSelected,
|
||||
'CallsList__Item--missed': wasMissed,
|
||||
'CallsList__Item--declined': wasDeclined,
|
||||
})}
|
||||
>
|
||||
<ListTile
|
||||
|
|
|
@ -35,6 +35,8 @@ import {
|
|||
useKeyboardShortcutsConditionally,
|
||||
useOpenContextMenu,
|
||||
} from '../../hooks/useKeyboardShortcuts';
|
||||
import { MINUTE } from '../../util/durations';
|
||||
import { isMoreRecentThan } from '../../util/timestamp';
|
||||
|
||||
export type PropsActionsType = {
|
||||
onOutgoingAudioCallInConversation: (conversationId: string) => void;
|
||||
|
@ -105,7 +107,9 @@ export const CallingNotification: React.FC<PropsType> = React.memo(
|
|||
icon={icon}
|
||||
kind={
|
||||
status === DirectCallStatus.Missed ||
|
||||
status === GroupCallStatus.Missed
|
||||
status === GroupCallStatus.Missed ||
|
||||
status === DirectCallStatus.Declined ||
|
||||
status === GroupCallStatus.Declined
|
||||
? SystemMessageKind.Danger
|
||||
: SystemMessageKind.Normal
|
||||
}
|
||||
|
@ -188,9 +192,21 @@ function renderCallingNotificationButton(
|
|||
}
|
||||
case CallMode.Group: {
|
||||
if (props.groupCallEnded) {
|
||||
return null;
|
||||
}
|
||||
if (props.activeConversationId != null) {
|
||||
const { direction, status, timestamp } = props.callHistory;
|
||||
if (
|
||||
(direction === CallDirection.Incoming &&
|
||||
(status === GroupCallStatus.Declined ||
|
||||
status === GroupCallStatus.Missed)) ||
|
||||
isMoreRecentThan(timestamp, 5 * MINUTE)
|
||||
) {
|
||||
buttonText = i18n('icu:calling__call-back');
|
||||
onClick = () => {
|
||||
onOutgoingVideoCallInConversation(conversationId);
|
||||
};
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
} else if (props.activeConversationId != null) {
|
||||
if (props.activeConversationId === conversationId) {
|
||||
buttonText = i18n('icu:calling__return');
|
||||
onClick = returnToActiveCall;
|
||||
|
|
|
@ -13,6 +13,7 @@ import {
|
|||
import type { LocalizerType } from '../../../types/I18N';
|
||||
import { formatDate, formatTime } from '../../../util/timestamp';
|
||||
import { PanelSection } from './PanelSection';
|
||||
import { getDirectCallNotificationText } from '../../../util/callingNotification';
|
||||
|
||||
function describeCallHistory(
|
||||
i18n: LocalizerType,
|
||||
|
@ -24,19 +25,27 @@ function describeCallHistory(
|
|||
return i18n('icu:CallHistory__Description--Adhoc');
|
||||
}
|
||||
|
||||
if (status === DirectCallStatus.Missed || status === GroupCallStatus.Missed) {
|
||||
if (direction === CallDirection.Incoming) {
|
||||
return i18n('icu:CallHistory__Description--Missed', { type });
|
||||
}
|
||||
return i18n('icu:CallHistory__Description--Unanswered', { type });
|
||||
}
|
||||
if (
|
||||
status === DirectCallStatus.Declined ||
|
||||
status === GroupCallStatus.Declined
|
||||
(type === CallType.Audio || type === CallType.Video) &&
|
||||
(status === DirectCallStatus.Accepted ||
|
||||
status === DirectCallStatus.Declined ||
|
||||
status === DirectCallStatus.Deleted ||
|
||||
status === DirectCallStatus.Missed ||
|
||||
status === DirectCallStatus.Pending)
|
||||
) {
|
||||
return i18n('icu:CallHistory__Description--Declined', { type });
|
||||
return getDirectCallNotificationText(direction, type, status, i18n);
|
||||
}
|
||||
return i18n('icu:CallHistory__Description--Default', { type, direction });
|
||||
|
||||
if (status === GroupCallStatus.Missed) {
|
||||
if (direction === CallDirection.Incoming) {
|
||||
return i18n('icu:CallHistory__DescriptionVideoCall--Missed');
|
||||
}
|
||||
return i18n('icu:CallHistory__DescriptionVideoCall--Unanswered');
|
||||
}
|
||||
if (status === GroupCallStatus.Declined) {
|
||||
return i18n('icu:CallHistory__DescriptionVideoCall--Declined');
|
||||
}
|
||||
return i18n('icu:CallHistory__DescriptionVideoCall--Default', { direction });
|
||||
}
|
||||
|
||||
export type CallHistoryPanelSectionProps = Readonly<{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue