Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3398017
D6934.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D6934.diff
View Options
diff --git a/keyserver/src/fetchers/message-fetchers.js b/keyserver/src/fetchers/message-fetchers.js
--- a/keyserver/src/fetchers/message-fetchers.js
+++ b/keyserver/src/fetchers/message-fetchers.js
@@ -7,7 +7,7 @@
shimUnsupportedRawMessageInfos,
} from 'lib/shared/message-utils.js';
import { messageSpecs } from 'lib/shared/messages/message-specs.js';
-import { notifCollapseKeyForRawMessageInfo } from 'lib/shared/notif-utils.js';
+import { getNotifCollapseKey } from 'lib/shared/notif-utils.js';
import { hasMinCodeVersion } from 'lib/shared/version-utils.js';
import {
type RawMessageInfo,
@@ -66,8 +66,10 @@
for (const userID in pushInfo) {
usersToCollapseKeysToInfo[userID] = {};
usersToCollapsableNotifInfo[userID] = [];
- for (const rawMessageInfo of pushInfo[userID].messageInfos) {
- const collapseKey = notifCollapseKeyForRawMessageInfo(rawMessageInfo);
+ for (let i = 0; i < pushInfo[userID].messageInfos.length; i++) {
+ const rawMessageInfo = pushInfo[userID].messageInfos[i];
+ const messageData = pushInfo[userID].messageDatas[i];
+ const collapseKey = getNotifCollapseKey(rawMessageInfo, messageData);
if (!collapseKey) {
const collapsableNotifInfo = {
collapseKey,
diff --git a/lib/shared/messages/message-spec.js b/lib/shared/messages/message-spec.js
--- a/lib/shared/messages/message-spec.js
+++ b/lib/shared/messages/message-spec.js
@@ -100,7 +100,10 @@
threadInfo: ThreadInfo,
params: NotificationTextsParams,
) => Promise<NotifTexts>,
- +notificationCollapseKey?: (rawMessageInfo: RawInfo) => string,
+ +notificationCollapseKey?: (
+ rawMessageInfo: RawInfo,
+ messageData: Data,
+ ) => string,
+generatesNotifs: (
rawMessageInfo: RawInfo,
messageData: Data,
diff --git a/lib/shared/notif-utils.js b/lib/shared/notif-utils.js
--- a/lib/shared/notif-utils.js
+++ b/lib/shared/notif-utils.js
@@ -10,6 +10,7 @@
type RawMessageInfo,
type RobotextMessageInfo,
type MessageType,
+ type MessageData,
messageTypes,
} from '../types/message-types.js';
import type { NotifTexts, ResolvedNotifTexts } from '../types/notif-types.js';
@@ -219,11 +220,14 @@
});
}
-function notifCollapseKeyForRawMessageInfo(
+function getNotifCollapseKey(
rawMessageInfo: RawMessageInfo,
+ messageData: MessageData,
): ?string {
const messageSpec = messageSpecs[rawMessageInfo.type];
- return messageSpec.notificationCollapseKey?.(rawMessageInfo) ?? null;
+ return (
+ messageSpec.notificationCollapseKey?.(rawMessageInfo, messageData) ?? null
+ );
}
type Unmerged = $ReadOnly<{
@@ -247,6 +251,6 @@
notifTextsForMessageInfo,
notifTextsForEntryCreationOrEdit,
notifTextsForSubthreadCreation,
- notifCollapseKeyForRawMessageInfo,
+ getNotifCollapseKey,
mergePrefixIntoBody,
};
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Dec 2, 8:21 PM (21 h, 15 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2608853
Default Alt Text
D6934.diff (2 KB)
Attached To
Mode
D6934: [keyserver] Drill MessageDatas into notificationCollapseKey
Attached
Detach File
Event Timeline
Log In to Comment