diff --git a/keyserver/src/push/send.js b/keyserver/src/push/send.js --- a/keyserver/src/push/send.js +++ b/keyserver/src/push/send.js @@ -125,7 +125,7 @@ ]); const [firstNewMessageInfo, ...remainingNewMessageInfos] = newMessageInfos; - const threadID = firstNewMessageInfo.threadID; + const { threadID } = firstNewMessageInfo; const threadInfo = threadInfos[threadID]; const updateBadge = threadInfo.currentUser.subscription.home; @@ -135,8 +135,11 @@ username && threadInfo.currentUser.role && oldValidUsernameRegex.test(username) && - firstNewMessageInfo.type === messageTypes.TEXT && - isMentioned(username, firstNewMessageInfo.text); + newMessageInfos.some( + newMessageInfo => + newMessageInfo.type === messageTypes.TEXT && + isMentioned(username, newMessageInfo.text), + ); if (!updateBadge && !displayBanner && !userWasMentioned) { continue; }