diff --git a/js/models/messages.js b/js/models/messages.js index d6c26a6ab186..93436c048c01 100644 --- a/js/models/messages.js +++ b/js/models/messages.js @@ -1000,6 +1000,12 @@ if (this.get('sticker')) { return i18n('message--getNotificationText--stickers'); } + if (this.isCallHistory()) { + return window.Signal.Components.getCallingNotificationText( + this.get('callHistoryDetails'), + window.i18n + ); + } if (this.isExpirationTimerUpdate()) { const { expireTimer } = this.get('expirationTimerUpdate'); if (!expireTimer) { diff --git a/js/modules/signal.js b/js/modules/signal.js index fcb804f269c0..ce0b309b9637 100644 --- a/js/modules/signal.js +++ b/js/modules/signal.js @@ -49,6 +49,9 @@ const { const { StagedLinkPreview, } = require('../../ts/components/conversation/StagedLinkPreview'); +const { + getCallingNotificationText, +} = require('../../ts/components/conversation/CallingNotification'); // State const { createTimeline } = require('../../ts/state/roots/createTimeline'); @@ -278,6 +281,7 @@ exports.setup = (options = {}) => { ContactListItem, ConversationHeader, Emojify, + getCallingNotificationText, Lightbox, LightboxGallery, MediaGallery, diff --git a/ts/components/conversation/CallingNotification.tsx b/ts/components/conversation/CallingNotification.tsx index 50b36b320bcb..54f670b2ddbe 100644 --- a/ts/components/conversation/CallingNotification.tsx +++ b/ts/components/conversation/CallingNotification.tsx @@ -15,7 +15,7 @@ type PropsHousekeeping = { type Props = PropsData & PropsHousekeeping; -function getMessage( +export function getCallingNotificationText( callHistoryDetails: CallHistoryDetailsType, i18n: LocalizerType ): string { @@ -76,7 +76,7 @@ export const CallingNotification = (props: Props): JSX.Element | null => { className={`module-message-calling--notification module-message-calling--${callType}`} >
- {getMessage(callHistoryDetails, i18n)} + {getCallingNotificationText(callHistoryDetails, i18n)}