Page MenuHomePhabricator

D6583.id22064.diff
No OneTemporary

D6583.id22064.diff

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<MessageInfo>,
threadInfo: ThreadInfo,
- params: NotificationTextsParams,
): Promise<NotifTexts> {
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}`,
};
},

File Metadata

Mime Type
text/plain
Expires
Tue, Oct 1, 2:37 AM (22 h, 7 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2208493
Default Alt Text
D6583.id22064.diff (1 KB)

Event Timeline