Page MenuHomePhabricator

D6581.diff
No OneTemporary

D6581.diff

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

File Metadata

Mime Type
text/plain
Expires
Sat, Dec 21, 8:40 AM (20 h, 13 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2687108
Default Alt Text
D6581.diff (1 KB)

Event Timeline