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 @@ -26,7 +26,10 @@ appendSQLArray, mergeOrConditions, } from '../database/database'; -import { fetchMessageInfoForLocalID } from '../fetchers/message-fetchers'; +import { + fetchMessageInfoForLocalID, + fetchMessageInfoByID, +} from '../fetchers/message-fetchers'; import { fetchOtherSessionsForViewer } from '../fetchers/session-fetchers'; import { fetchServerThreadInfos } from '../fetchers/thread-fetchers'; import { sendPushNotifs } from '../push/send'; @@ -378,7 +381,16 @@ invariant(messageIndices, `indices should exist for thread ${threadID}`); for (const messageIndex of messageIndices) { const messageInfo = messageInfos[messageIndex]; - if ( + if (messageInfo.type === messageTypes.REACTION) { + const targetMessageInfo = await fetchMessageInfoByID( + viewer, + messageInfo.targetMessageID, + ); + if (targetMessageInfo?.creatorID !== userID) { + continue; + } + userPushInfo.messageInfos.push(messageInfo); + } else if ( (messageInfo.type !== messageTypes.CREATE_SUB_THREAD || subthreadsCanNotify.has(messageInfo.childThreadID)) && messageTypeGeneratesNotifs(messageInfo.type) &&