Update call strings

This commit is contained in:
ayumi-signal 2024-07-30 16:21:33 -07:00 committed by GitHub
parent a634792be7
commit 26140ee3d6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 289 additions and 53 deletions

View file

@ -469,7 +469,7 @@
}, },
"icu:ContactListItem__menu__audio-call": { "icu:ContactListItem__menu__audio-call": {
"messageformat": "Voice call", "messageformat": "Voice call",
"description": "Shown in a context menu for a contact, allows the user to start the audio call with the contact" "description": "Shown in a context menu for a contact, allows the user to start the voice call with the contact"
}, },
"icu:ContactListItem__menu__video-call": { "icu:ContactListItem__menu__video-call": {
"messageformat": "Video call", "messageformat": "Video call",
@ -1598,19 +1598,19 @@
"description": "Header for calling options on the settings screen" "description": "Header for calling options on the settings screen"
}, },
"icu:calling__call-back": { "icu:calling__call-back": {
"messageformat": "Call Back", "messageformat": "Call back",
"description": "Button to call someone back" "description": "Button to call someone back"
}, },
"icu:calling__call-again": { "icu:calling__call-again": {
"messageformat": "Call Again", "messageformat": "Call again",
"description": "Button to call someone again" "description": "Button to call someone again"
}, },
"icu:calling__join": { "icu:calling__join": {
"messageformat": "Join Call", "messageformat": "Join call",
"description": "Button label in the call lobby for joining a call" "description": "Button label in the call lobby for joining a call"
}, },
"icu:calling__return": { "icu:calling__return": {
"messageformat": "Return to Call", "messageformat": "Return to call",
"description": "Button label in the call lobby for returning to a call" "description": "Button label in the call lobby for returning to a call"
}, },
"icu:calling__lobby-automatically-muted-because-there-are-a-lot-of-people": { "icu:calling__lobby-automatically-muted-because-there-are-a-lot-of-people": {
@ -3496,11 +3496,11 @@
"description": "Shown in tooltip for the button to decline a call (audio or video)" "description": "Shown in tooltip for the button to decline a call (audio or video)"
}, },
"icu:declinedIncomingAudioCall": { "icu:declinedIncomingAudioCall": {
"messageformat": "You declined a voice call", "messageformat": "Declined voice call",
"description": "Shown in conversation history when you declined an incoming voice call" "description": "Shown in conversation history when you declined an incoming voice call"
}, },
"icu:declinedIncomingVideoCall": { "icu:declinedIncomingVideoCall": {
"messageformat": "You declined a video call", "messageformat": "Declined video call",
"description": "Shown in conversation history when you declined an incoming video call" "description": "Shown in conversation history when you declined an incoming video call"
}, },
"icu:acceptedIncomingAudioCall": { "icu:acceptedIncomingAudioCall": {
@ -3544,11 +3544,11 @@
"description": "Shown in a notification body when Signal is minimized to tray" "description": "Shown in a notification body when Signal is minimized to tray"
}, },
"icu:incomingAudioCall": { "icu:incomingAudioCall": {
"messageformat": "Incoming voice call...", "messageformat": "Incoming voice call",
"description": "Shown in both the incoming call bar and notification for an incoming voice call" "description": "Shown in both the incoming call bar and notification for an incoming voice call"
}, },
"icu:incomingVideoCall": { "icu:incomingVideoCall": {
"messageformat": "Incoming video call...", "messageformat": "Incoming video call",
"description": "Shown in both the incoming call bar and notification for an incoming video call" "description": "Shown in both the incoming call bar and notification for an incoming video call"
}, },
"icu:outgoingAudioCall": { "icu:outgoingAudioCall": {
@ -3608,8 +3608,8 @@
"description": "Shown in the call screen and lobby for group calls to specify the number of members in the call or in the group. Count is at always at least 1." "description": "Shown in the call screen and lobby for group calls to specify the number of members in the call or in the group. Count is at always at least 1."
}, },
"icu:CallControls__InfoDisplay--audio-call": { "icu:CallControls__InfoDisplay--audio-call": {
"messageformat": "Audio call", "messageformat": "Voice call",
"description": "Shown in the call lobby for a direct 1:1 call when the caller's video is disabled, to specify that an audio call will be placed when clicking the Start button." "description": "Shown in the call lobby for a direct 1:1 call when the caller's video is disabled, to specify that a voice call will be placed when clicking the Start button."
}, },
"icu:CallControls__InfoDisplay--adhoc-call": { "icu:CallControls__InfoDisplay--adhoc-call": {
"messageformat": "Call link", "messageformat": "Call link",
@ -3692,19 +3692,19 @@
"description": "Title for participants list toggle" "description": "Title for participants list toggle"
}, },
"icu:calling__call-notification__ended": { "icu:calling__call-notification__ended": {
"messageformat": "The group call has ended", "messageformat": "The video call has ended",
"description": "Notification message when a group call has ended" "description": "Notification message when a group call has ended"
}, },
"icu:calling__call-notification__started-by-someone": { "icu:calling__call-notification__started-by-someone": {
"messageformat": "A group call was started", "messageformat": "A video call was started",
"description": "Notification message when a group call has started, but we don't know who started it" "description": "Notification message when a group call has started, but we don't know who started it"
}, },
"icu:calling__call-notification__started-by-you": { "icu:calling__call-notification__started-by-you": {
"messageformat": "You started a group call", "messageformat": "You started a video call",
"description": "Notification message when a group call has started by you" "description": "Notification message when a group call has started by you"
}, },
"icu:calling__call-notification__started": { "icu:calling__call-notification__started": {
"messageformat": "{name} started a group call", "messageformat": "{name} started a video call",
"description": "Notification message when a group call has started" "description": "Notification message when a group call has started"
}, },
"icu:calling__in-another-call-tooltip": { "icu:calling__in-another-call-tooltip": {
@ -4765,7 +4765,7 @@
}, },
"icu:ContactModal--already-in-call": { "icu:ContactModal--already-in-call": {
"messageformat": "You are already in a call", "messageformat": "You are already in a call",
"description": "Tooltip text for video or audio call button in Contact Details modal" "description": "Tooltip text for video or voice call button in Contact Details modal"
}, },
"icu:showChatColorEditor": { "icu:showChatColorEditor": {
"messageformat": "Chat color", "messageformat": "Chat color",
@ -7225,9 +7225,13 @@
"messageformat": "Missed", "messageformat": "Missed",
"description": "Calls Tab > Calls List > Call Item > Call Status > When call was missed" "description": "Calls Tab > Calls List > Call Item > Call Status > When call was missed"
}, },
"icu:CallsList__ItemCallInfo--Declined": {
"messageformat": "Declined",
"description": "Calls Tab > Calls List > Call Item > Call Status > When an incoming call was declined"
},
"icu:CallsList__ItemCallInfo--GroupCall": { "icu:CallsList__ItemCallInfo--GroupCall": {
"messageformat": "Group call", "messageformat": "Group call",
"description": "Calls Tab > Calls List > Call Item > Call Status > When group call is in its default state" "description": "(Deleted 2024/07/26) Calls Tab > Calls List > Call Item > Call Status > When group call is in its default state"
}, },
"icu:CallsList__ItemCallInfo--CallLink": { "icu:CallsList__ItemCallInfo--CallLink": {
"messageformat": "Call link", "messageformat": "Call link",
@ -7267,24 +7271,40 @@
}, },
"icu:CallHistory__Description--Default": { "icu:CallHistory__Description--Default": {
"messageformat": "{direction, select, Outgoing {Outgoing} other {Incoming}} {type, select, Audio {voice} Video {video} Group {group} other {}} call", "messageformat": "{direction, select, Outgoing {Outgoing} other {Incoming}} {type, select, Audio {voice} Video {video} Group {group} other {}} call",
"description": "Call History > Short description of call > When call was not missed or declined (generally accepted)" "description": "(Deleted 2024/07/30) Call History > Short description of call > When call was not missed or declined (generally accepted)"
}, },
"icu:CallHistory__Description--Missed": { "icu:CallHistory__Description--Missed": {
"messageformat": "Missed {type, select, Audio {voice} Video {video} Group {group} other {}} call", "messageformat": "Missed {type, select, Audio {voice} Video {video} Group {group} other {}} call",
"description": "Call History > Short description of call > When incoming call was missed" "description": "(Deleted 2024/07/30) Call History > Short description of call > When incoming call was missed"
}, },
"icu:CallHistory__Description--Unanswered": { "icu:CallHistory__Description--Unanswered": {
"messageformat": "Unanswered {type, select, Audio {voice} Video {video} Group {group} other {}} call", "messageformat": "Unanswered {type, select, Audio {voice} Video {video} Group {group} other {}} call",
"description": "Call History > Short description of call > When outgoing call was unanswered" "description": "(Deleted 2024/07/30) Call History > Short description of call > When outgoing call was unanswered"
}, },
"icu:CallHistory__Description--Declined": { "icu:CallHistory__Description--Declined": {
"messageformat": "Declined {type, select, Audio {voice} Video {video} Group {group} other {}} call", "messageformat": "Declined {type, select, Audio {voice} Video {video} Group {group} other {}} call",
"description": "Call History > Short description of call > When call was declined" "description": "(Deleted 2024/07/30) Call History > Short description of call > When call was declined"
}, },
"icu:CallHistory__Description--Adhoc": { "icu:CallHistory__Description--Adhoc": {
"messageformat": "Call link", "messageformat": "Call link",
"description": "Call History > Short description of call > When you joined a call link call" "description": "Call History > Short description of call > When you joined a call link call"
}, },
"icu:CallHistory__DescriptionVideoCall--Default": {
"messageformat": "{direction, select, Outgoing {Outgoing} other {Incoming}} video call",
"description": "Call History > Short description of call > When group or direct video call was not missed or declined (generally accepted)"
},
"icu:CallHistory__DescriptionVideoCall--Missed": {
"messageformat": "Missed video call",
"description": "Call History > Short description of call > When incoming group or direct video call was missed"
},
"icu:CallHistory__DescriptionVideoCall--Unanswered": {
"messageformat": "Unanswered video call",
"description": "Call History > Short description of call > When outgoing group or direct video call was unanswered"
},
"icu:CallHistory__DescriptionVideoCall--Declined": {
"messageformat": "Declined video call",
"description": "Call History > Short description of call > When group or direct video call was declined"
},
"icu:CallLinkDetails__Join": { "icu:CallLinkDetails__Join": {
"messageformat": "Join", "messageformat": "Join",
"description": "Call History > Call Link Details > Join Button" "description": "Call History > Call Link Details > Join Button"

View file

@ -235,7 +235,8 @@
} }
// Override .ListTile__subtitle so ellipsis is correct color // Override .ListTile__subtitle so ellipsis is correct color
.CallsList__Item--missed .ListTile__subtitle { .CallsList__Item--missed .ListTile__subtitle,
.CallsList__Item--declined .ListTile__subtitle {
// Need to override the themed selector specificity of .ListTile__subtitle // Need to override the themed selector specificity of .ListTile__subtitle
@include light-theme { @include light-theme {
color: $color-accent-red; color: $color-accent-red;

View file

@ -758,14 +758,18 @@ export function CallsList({
item.direction === CallDirection.Incoming && item.direction === CallDirection.Incoming &&
(item.status === DirectCallStatus.Missed || (item.status === DirectCallStatus.Missed ||
item.status === GroupCallStatus.Missed); item.status === GroupCallStatus.Missed);
const wasDeclined =
item.direction === CallDirection.Incoming &&
(item.status === DirectCallStatus.Declined ||
item.status === GroupCallStatus.Declined);
let statusText; let statusText;
if (wasMissed) { if (wasMissed) {
statusText = i18n('icu:CallsList__ItemCallInfo--Missed'); statusText = i18n('icu:CallsList__ItemCallInfo--Missed');
} else if (wasDeclined) {
statusText = i18n('icu:CallsList__ItemCallInfo--Declined');
} else if (isAdhoc) { } else if (isAdhoc) {
statusText = i18n('icu:CallsList__ItemCallInfo--CallLink'); statusText = i18n('icu:CallsList__ItemCallInfo--CallLink');
} else if (item.type === CallType.Group) {
statusText = i18n('icu:CallsList__ItemCallInfo--GroupCall');
} else if (item.direction === CallDirection.Outgoing) { } else if (item.direction === CallDirection.Outgoing) {
statusText = i18n('icu:CallsList__ItemCallInfo--Outgoing'); statusText = i18n('icu:CallsList__ItemCallInfo--Outgoing');
} else if (item.direction === CallDirection.Incoming) { } else if (item.direction === CallDirection.Incoming) {
@ -819,6 +823,7 @@ export function CallsList({
className={classNames('CallsList__Item', { className={classNames('CallsList__Item', {
'CallsList__Item--selected': isSelected, 'CallsList__Item--selected': isSelected,
'CallsList__Item--missed': wasMissed, 'CallsList__Item--missed': wasMissed,
'CallsList__Item--declined': wasDeclined,
})} })}
> >
<ListTile <ListTile

View file

@ -35,6 +35,8 @@ import {
useKeyboardShortcutsConditionally, useKeyboardShortcutsConditionally,
useOpenContextMenu, useOpenContextMenu,
} from '../../hooks/useKeyboardShortcuts'; } from '../../hooks/useKeyboardShortcuts';
import { MINUTE } from '../../util/durations';
import { isMoreRecentThan } from '../../util/timestamp';
export type PropsActionsType = { export type PropsActionsType = {
onOutgoingAudioCallInConversation: (conversationId: string) => void; onOutgoingAudioCallInConversation: (conversationId: string) => void;
@ -105,7 +107,9 @@ export const CallingNotification: React.FC<PropsType> = React.memo(
icon={icon} icon={icon}
kind={ kind={
status === DirectCallStatus.Missed || status === DirectCallStatus.Missed ||
status === GroupCallStatus.Missed status === GroupCallStatus.Missed ||
status === DirectCallStatus.Declined ||
status === GroupCallStatus.Declined
? SystemMessageKind.Danger ? SystemMessageKind.Danger
: SystemMessageKind.Normal : SystemMessageKind.Normal
} }
@ -188,9 +192,21 @@ function renderCallingNotificationButton(
} }
case CallMode.Group: { case CallMode.Group: {
if (props.groupCallEnded) { if (props.groupCallEnded) {
return null; const { direction, status, timestamp } = props.callHistory;
} if (
if (props.activeConversationId != null) { (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) { if (props.activeConversationId === conversationId) {
buttonText = i18n('icu:calling__return'); buttonText = i18n('icu:calling__return');
onClick = returnToActiveCall; onClick = returnToActiveCall;

View file

@ -13,6 +13,7 @@ import {
import type { LocalizerType } from '../../../types/I18N'; import type { LocalizerType } from '../../../types/I18N';
import { formatDate, formatTime } from '../../../util/timestamp'; import { formatDate, formatTime } from '../../../util/timestamp';
import { PanelSection } from './PanelSection'; import { PanelSection } from './PanelSection';
import { getDirectCallNotificationText } from '../../../util/callingNotification';
function describeCallHistory( function describeCallHistory(
i18n: LocalizerType, i18n: LocalizerType,
@ -24,19 +25,27 @@ function describeCallHistory(
return i18n('icu:CallHistory__Description--Adhoc'); 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 ( if (
status === DirectCallStatus.Declined || (type === CallType.Audio || type === CallType.Video) &&
status === GroupCallStatus.Declined (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<{ export type CallHistoryPanelSectionProps = Readonly<{

View file

@ -16,6 +16,7 @@ import {
GroupCallStatus, GroupCallStatus,
} from '../../types/CallDisposition'; } from '../../types/CallDisposition';
import { getPeerIdFromConversation } from '../../util/callDisposition'; import { getPeerIdFromConversation } from '../../util/callDisposition';
import { HOUR } from '../../util/durations';
describe('calling notification helpers', () => { describe('calling notification helpers', () => {
const i18n = setupI18n('en', enMessages); const i18n = setupI18n('en', enMessages);
@ -23,7 +24,7 @@ describe('calling notification helpers', () => {
describe('getCallingNotificationText', () => { describe('getCallingNotificationText', () => {
// Direct call behavior is not tested here. // Direct call behavior is not tested here.
it('says that the call has ended', () => { it('says that the incoming call has ended', () => {
const callCreator = getDefaultConversation(); const callCreator = getDefaultConversation();
assert.strictEqual( assert.strictEqual(
getCallingNotificationText( getCallingNotificationText(
@ -36,6 +37,122 @@ describe('calling notification helpers', () => {
type: CallType.Group, type: CallType.Group,
direction: CallDirection.Incoming, direction: CallDirection.Incoming,
timestamp: Date.now(), timestamp: Date.now(),
status: GroupCallStatus.Joined,
},
callCreator,
activeConversationId: null,
groupCallEnded: true,
deviceCount: 1,
maxDevices: 23,
isSelectMode: false,
isTargeted: false,
},
i18n
),
'The video call has ended'
);
});
it('says that the outgoing call has ended', () => {
const callCreator = getDefaultConversation();
assert.strictEqual(
getCallingNotificationText(
{
callHistory: {
callId: '123',
peerId: getPeerIdFromConversation(getDefaultGroup()),
ringerId: callCreator.serviceId ?? null,
mode: CallMode.Group,
type: CallType.Group,
direction: CallDirection.Outgoing,
timestamp: Date.now(),
status: GroupCallStatus.Joined,
},
callCreator,
activeConversationId: null,
groupCallEnded: true,
deviceCount: 1,
maxDevices: 23,
isSelectMode: false,
isTargeted: false,
},
i18n
),
'The video call has ended'
);
});
it('says declined incoming calls', () => {
const callCreator = getDefaultConversation();
assert.strictEqual(
getCallingNotificationText(
{
callHistory: {
callId: '123',
peerId: getPeerIdFromConversation(getDefaultGroup()),
ringerId: callCreator.serviceId ?? null,
mode: CallMode.Group,
type: CallType.Group,
direction: CallDirection.Incoming,
timestamp: Date.now(),
status: GroupCallStatus.Declined,
},
callCreator,
activeConversationId: null,
groupCallEnded: true,
deviceCount: 1,
maxDevices: 23,
isSelectMode: false,
isTargeted: false,
},
i18n
),
'Declined video call'
);
});
it('says older ended incoming calls', () => {
const callCreator = getDefaultConversation();
assert.strictEqual(
getCallingNotificationText(
{
callHistory: {
callId: '123',
peerId: getPeerIdFromConversation(getDefaultGroup()),
ringerId: callCreator.serviceId ?? null,
mode: CallMode.Group,
type: CallType.Group,
direction: CallDirection.Incoming,
timestamp: Date.now() - HOUR,
status: GroupCallStatus.Joined,
},
callCreator,
activeConversationId: null,
groupCallEnded: true,
deviceCount: 1,
maxDevices: 23,
isSelectMode: false,
isTargeted: false,
},
i18n
),
'Incoming video call'
);
});
it('says older ended incoming missed calls', () => {
const callCreator = getDefaultConversation();
assert.strictEqual(
getCallingNotificationText(
{
callHistory: {
callId: '123',
peerId: getPeerIdFromConversation(getDefaultGroup()),
ringerId: callCreator.serviceId ?? null,
mode: CallMode.Group,
type: CallType.Group,
direction: CallDirection.Incoming,
timestamp: Date.now() - HOUR,
status: GroupCallStatus.Missed, status: GroupCallStatus.Missed,
}, },
callCreator, callCreator,
@ -48,7 +165,36 @@ describe('calling notification helpers', () => {
}, },
i18n i18n
), ),
'The group call has ended' 'Missed video call'
);
});
it('says older ended outgoing calls', () => {
const callCreator = getDefaultConversation();
assert.strictEqual(
getCallingNotificationText(
{
callHistory: {
callId: '123',
peerId: getPeerIdFromConversation(getDefaultGroup()),
ringerId: callCreator.serviceId ?? null,
mode: CallMode.Group,
type: CallType.Group,
direction: CallDirection.Outgoing,
timestamp: Date.now() - HOUR,
status: GroupCallStatus.Joined,
},
callCreator,
activeConversationId: null,
groupCallEnded: true,
deviceCount: 1,
maxDevices: 23,
isSelectMode: false,
isTargeted: false,
},
i18n
),
'Outgoing video call'
); );
}); });
@ -79,7 +225,7 @@ describe('calling notification helpers', () => {
}, },
i18n i18n
), ),
'Luigi started a group call' 'Luigi started a video call'
); );
}); });
@ -111,7 +257,7 @@ describe('calling notification helpers', () => {
}, },
i18n i18n
), ),
'Luigi Mario started a group call' 'Luigi Mario started a video call'
); );
}); });
@ -142,7 +288,7 @@ describe('calling notification helpers', () => {
}, },
i18n i18n
), ),
'You started a group call' 'You started a video call'
); );
}); });
@ -170,7 +316,7 @@ describe('calling notification helpers', () => {
}, },
i18n i18n
), ),
'A group call was started' 'A video call was started'
); );
}); });
}); });

View file

@ -10,9 +10,12 @@ import {
DirectCallStatus, DirectCallStatus,
type CallHistoryDetails, type CallHistoryDetails,
CallType, CallType,
GroupCallStatus,
} from '../types/CallDisposition'; } from '../types/CallDisposition';
import type { ConversationType } from '../state/ducks/conversations'; import type { ConversationType } from '../state/ducks/conversations';
import { strictAssert } from './assert'; import { strictAssert } from './assert';
import { isMoreRecentThan } from './timestamp';
import { MINUTE } from './durations';
export type CallingNotificationType = Readonly<{ export type CallingNotificationType = Readonly<{
// In some older calls, we don't have a call id, this hardens against that. // In some older calls, we don't have a call id, this hardens against that.
@ -26,7 +29,7 @@ export type CallingNotificationType = Readonly<{
isTargeted: boolean; isTargeted: boolean;
}>; }>;
function getDirectCallNotificationText( export function getDirectCallNotificationText(
callDirection: CallDirection, callDirection: CallDirection,
callType: CallType, callType: CallType,
callStatus: DirectCallStatus, callStatus: DirectCallStatus,
@ -85,14 +88,41 @@ function getDirectCallNotificationText(
throw missingCaseError(callStatus); throw missingCaseError(callStatus);
} }
function getGroupCallNotificationText( function getGroupCallNotificationText({
groupCallEnded: boolean, groupCallEnded,
creator: ConversationType | null, creator,
i18n: LocalizerType callHistory,
): string { i18n,
}: {
groupCallEnded: boolean;
creator: ConversationType | null;
callHistory: CallHistoryDetails;
i18n: LocalizerType;
}): string {
if (groupCallEnded) { if (groupCallEnded) {
return i18n('icu:calling__call-notification__ended'); const { direction, status, timestamp } = callHistory;
if (direction === CallDirection.Incoming) {
if (status === GroupCallStatus.Declined) {
return i18n('icu:CallHistory__DescriptionVideoCall--Declined');
}
if (status === GroupCallStatus.Missed) {
return i18n('icu:CallHistory__DescriptionVideoCall--Missed');
}
if (isMoreRecentThan(timestamp, 5 * MINUTE)) {
return i18n('icu:calling__call-notification__ended');
}
return i18n('icu:acceptedIncomingVideoCall');
}
// Outgoing ended group calls
if (isMoreRecentThan(timestamp, 5 * MINUTE)) {
return i18n('icu:calling__call-notification__ended');
}
return i18n('icu:acceptedOutgoingVideoCall');
} }
// TODO: Active call with participants DESKTOP-7439
if (creator == null) { if (creator == null) {
return i18n('icu:calling__call-notification__started-by-someone'); return i18n('icu:calling__call-notification__started-by-someone');
} }
@ -108,7 +138,11 @@ export function getCallingNotificationText(
callingNotification: CallingNotificationType, callingNotification: CallingNotificationType,
i18n: LocalizerType i18n: LocalizerType
): string | null { ): string | null {
const { callHistory, callCreator, groupCallEnded } = callingNotification; const {
callHistory,
callCreator: creator,
groupCallEnded,
} = callingNotification;
if (callHistory == null) { if (callHistory == null) {
return null; return null;
} }
@ -126,7 +160,12 @@ export function getCallingNotificationText(
groupCallEnded != null, groupCallEnded != null,
'getCallingNotificationText: groupCallEnded shouldnt be null for a group call' 'getCallingNotificationText: groupCallEnded shouldnt be null for a group call'
); );
return getGroupCallNotificationText(groupCallEnded, callCreator, i18n); return getGroupCallNotificationText({
groupCallEnded,
creator,
callHistory,
i18n,
});
} }
if (callHistory.mode === CallMode.Adhoc) { if (callHistory.mode === CallMode.Adhoc) {
return null; return null;