Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F2847259
D6583.id22064.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D6583.id22064.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D6583: [lib] Migrate Reaction notifText to use EntityText
Attached
Detach File
Event Timeline
Log In to Comment