Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F32281555
D6934.1765266469.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D6934.1765266469.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
Tue, Dec 9, 7:47 AM (7 h, 47 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5848163
Default Alt Text
D6934.1765266469.diff (2 KB)
Attached To
Mode
D6934: [keyserver] Drill MessageDatas into notificationCollapseKey
Attached
Detach File
Event Timeline
Log In to Comment