Page MenuHomePhabricator

D6874.diff
No OneTemporary

D6874.diff

diff --git a/lib/shared/messages/create-sidebar-message-spec.js b/lib/shared/messages/create-sidebar-message-spec.js
--- a/lib/shared/messages/create-sidebar-message-spec.js
+++ b/lib/shared/messages/create-sidebar-message-spec.js
@@ -6,6 +6,7 @@
pushTypes,
type CreateMessageInfoParams,
type MessageSpec,
+ type NotificationTextsParams,
} from './message-spec.js';
import { joinResult } from './utils.js';
import type { PlatformDetails } from '../../types/device-types.js';
@@ -28,6 +29,7 @@
type EntityText,
pluralizeEntityText,
} from '../../utils/entity-text.js';
+import { isMentioned } from '../mention-utils.js';
import { hasMinCodeVersion } from '../version-utils.js';
export const createSidebarMessageSpec: MessageSpec<
@@ -178,6 +180,7 @@
async notificationTexts(
messageInfos: $ReadOnlyArray<MessageInfo>,
threadInfo: ThreadInfo,
+ params: NotificationTextsParams,
): Promise<NotifTexts> {
const firstMessageInfo = messageInfos[0];
invariant(
@@ -196,7 +199,19 @@
let body = `started a thread in response to `;
body = ET`${body} ${sourceMessageAuthorPossessive} message`;
- if (initialName) {
+
+ const { username } = params.notifTargetUserInfo;
+
+ const secondMessageInfo = messageInfos[1];
+ if (
+ username &&
+ secondMessageInfo &&
+ secondMessageInfo.type === messageTypes.SIDEBAR_SOURCE &&
+ secondMessageInfo.sourceMessage.type === messageTypes.TEXT &&
+ isMentioned(username, secondMessageInfo.sourceMessage.text)
+ ) {
+ body = ET`${body} that tagged you`;
+ } else if (initialName) {
body = ET`${body} "${initialName}"`;
}

File Metadata

Mime Type
text/plain
Expires
Sun, Dec 22, 11:07 PM (18 h, 39 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2692806
Default Alt Text
D6874.diff (1 KB)

Event Timeline