diff --git a/lib/shared/messages/reaction-message-spec.js b/lib/shared/messages/reaction-message-spec.js --- a/lib/shared/messages/reaction-message-spec.js +++ b/lib/shared/messages/reaction-message-spec.js @@ -20,13 +20,11 @@ import type { RelativeUserInfo } from '../../types/user-types'; import { ET } from '../../utils/entity-text'; import { threadIsGroupChat } from '../thread-utils'; -import { stringForUser } from '../user-utils'; import { hasMinCodeVersion } from '../version-utils'; import { pushTypes, type MessageSpec, type MessageTitleParam, - type NotificationTextsParams, type GeneratesNotifsParams, } from './message-spec'; import { assertSingleMessageInfo, joinResult } from './utils'; @@ -163,7 +161,6 @@ async notificationTexts( messageInfos: $ReadOnlyArray, threadInfo: ThreadInfo, - params: NotificationTextsParams, ): Promise { const messageInfo = assertSingleMessageInfo(messageInfos); invariant( @@ -171,25 +168,23 @@ 'messageInfo should be reaction type', ); - const userString = stringForUser(messageInfo.creator); + const creator = ET.user({ userInfo: messageInfo.creator }); const body = messageInfo.action === 'add_reaction' ? 'reacted to your message' : 'unreacted to your message'; - let merged; - if (!threadInfo.name && !threadIsGroupChat(threadInfo)) { - merged = `${userString} ${body}`; - } else { - const threadName = params.notifThreadName(threadInfo); - merged = `${userString} ${body} in ${threadName}`; + let merged = ET`${creator} ${body}`; + if (threadInfo.name || threadIsGroupChat(threadInfo)) { + const thread = ET.thread({ display: 'shortName', threadInfo }); + merged = ET`${merged} in ${thread}`; } return { merged, body, title: threadInfo.uiName, - prefix: userString, + prefix: ET`${creator}`, }; },