Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3513195
D6874.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
D6874.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D6874: [lib] Make CreateSidebar notifs say when the OP tags the notif recipient
Attached
Detach File
Event Timeline
Log In to Comment