Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F33324648
D6874.1768858555.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D6874.1768858555.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
Mon, Jan 19, 9:35 PM (7 h, 49 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5958256
Default Alt Text
D6874.1768858555.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