diff --git a/lib/shared/messages/text-message-spec.js b/lib/shared/messages/text-message-spec.js --- a/lib/shared/messages/text-message-spec.js +++ b/lib/shared/messages/text-message-spec.js @@ -24,11 +24,9 @@ stripSpoilersFromMarkdownAST, } from '../markdown'; import { threadIsGroupChat } from '../thread-utils'; -import { stringForUser } from '../user-utils'; import { pushTypes, type MessageSpec, - type NotificationTextsParams, type RawMessageInfoFromServerDBRowParams, } from './message-spec'; import { assertSingleMessageInfo } from './utils'; @@ -169,7 +167,6 @@ async notificationTexts( messageInfos: $ReadOnlyArray, threadInfo: ThreadInfo, - params: NotificationTextsParams, ): Promise { const messageInfo = assertSingleMessageInfo(messageInfos); invariant( @@ -180,19 +177,20 @@ messageInfo.text, ); if (!threadInfo.name && !threadIsGroupChat(threadInfo)) { + const thread = ET.thread({ display: 'uiName', threadInfo }); return { - merged: `${threadInfo.uiName}: ${notificationTextWithoutSpoilers}`, + merged: ET`${thread}: ${notificationTextWithoutSpoilers}`, body: notificationTextWithoutSpoilers, title: threadInfo.uiName, }; } else { - const userString = stringForUser(messageInfo.creator); - const threadName = params.notifThreadName(threadInfo); + const creator = ET.user({ userInfo: messageInfo.creator }); + const thread = ET.thread({ display: 'shortName', threadInfo }); return { - merged: `${userString} to ${threadName}: ${notificationTextWithoutSpoilers}`, + merged: ET`${creator} to ${thread}: ${notificationTextWithoutSpoilers}`, body: notificationTextWithoutSpoilers, title: threadInfo.uiName, - prefix: `${userString}:`, + prefix: ET`${creator}:`, }; } },