Page MenuHomePhabricator

D6797.id22783.diff
No OneTemporary

D6797.id22783.diff

diff --git a/keyserver/src/creators/message-creator.js b/keyserver/src/creators/message-creator.js
--- a/keyserver/src/creators/message-creator.js
+++ b/keyserver/src/creators/message-creator.js
@@ -186,6 +186,7 @@
threadsToMessageIndices,
subthreadPermissionsToCheck,
stripLocalIDs(newMessageInfos),
+ newMessageDatas,
updatesForCurrentSession,
);
if (!viewer.isScriptViewer) {
@@ -291,6 +292,7 @@
threadsToMessageIndices: Map<string, number[]>,
subthreadPermissionsToCheck: Set<string>,
messageInfos: RawMessageInfo[],
+ messageDatas: MessageData[],
updatesForCurrentSession: UpdatesForCurrentSession,
) {
let joinIndex = 0;
@@ -435,12 +437,17 @@
return undefined;
}
const { generatesNotifs } = messageSpecs[type];
- const doesGenerateNotif = await generatesNotifs(messageInfo, {
- notifTargetUserID: userID,
- userNotMemberOfSubthreads,
- fetchMessageInfoByID: (messageID: string) =>
- fetchMessageInfoByID(viewer, messageID),
- });
+ const messageData = messageDatas[messageIndex];
+ const doesGenerateNotif = await generatesNotifs(
+ messageInfo,
+ messageData,
+ {
+ notifTargetUserID: userID,
+ userNotMemberOfSubthreads,
+ fetchMessageInfoByID: (messageID: string) =>
+ fetchMessageInfoByID(viewer, messageID),
+ },
+ );
return doesGenerateNotif === pushTypes.NOTIF
? messageInfo
: undefined;
diff --git a/lib/shared/messages/create-sub-thread-message-spec.js b/lib/shared/messages/create-sub-thread-message-spec.js
--- a/lib/shared/messages/create-sub-thread-message-spec.js
+++ b/lib/shared/messages/create-sub-thread-message-spec.js
@@ -146,6 +146,7 @@
generatesNotifs: async (
rawMessageInfo: RawCreateSubthreadMessageInfo,
+ messageData: CreateSubthreadMessageData,
params: GeneratesNotifsParams,
) => {
const { userNotMemberOfSubthreads } = params;
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
@@ -96,6 +96,7 @@
+notificationCollapseKey?: (rawMessageInfo: RawInfo) => string,
+generatesNotifs: (
rawMessageInfo: RawInfo,
+ messageData: Data,
params: GeneratesNotifsParams,
) => Promise<?PushType>,
+userIDs?: (rawMessageInfo: RawInfo) => $ReadOnlyArray<string>,
diff --git a/lib/shared/messages/reaction-message-spec.js b/lib/shared/messages/reaction-message-spec.js
--- a/lib/shared/messages/reaction-message-spec.js
+++ b/lib/shared/messages/reaction-message-spec.js
@@ -199,6 +199,7 @@
generatesNotifs: async (
rawMessageInfo: RawReactionMessageInfo,
+ messageData: ReactionMessageData,
params: GeneratesNotifsParams,
) => {
const { notifTargetUserID, fetchMessageInfoByID } = params;

File Metadata

Mime Type
text/plain
Expires
Wed, Jan 8, 4:24 PM (3 h, 45 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2820093
Default Alt Text
D6797.id22783.diff (2 KB)

Event Timeline