Skip to content

Commit

Permalink
Merge pull request #1992 from deathandmayhem/zarvox-fix-chat-hook-tag…
Browse files Browse the repository at this point in the history
…-bug

Send puzzle-solved notifications only to the solved-puzzle's hunt
  • Loading branch information
zarvox authored Jan 15, 2024
2 parents bb48e25 + 2a07f12 commit 028e0a8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion imports/server/hooks/ChatHooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,13 @@ const ChatHooks: Hookset = {
group.name.substring("group:".length),
);
const metaTags = await Tags.find({
name: { $in: groupNames.map((name) => `meta-for:${name}`) },
hunt: puzzle.hunt,
name: {
$in: groupNames.map((name) => `meta-for:${name}`),
},
}).fetchAsync();
const puzzlesWithMetaTags = await Puzzles.find({
hunt: puzzle.hunt,
tags: { $in: metaTags.map((tag) => tag._id) },
_id: { $ne: puzzleId }, // Avoid sending a notification to the puzzle that was just solved.
}).fetchAsync();
Expand Down

0 comments on commit 028e0a8

Please sign in to comment.