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, subthreadPermissionsToCheck: Set, 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, +userIDs?: (rawMessageInfo: RawInfo) => $ReadOnlyArray, 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;