Skip to content

Commit

Permalink
Merge pull request #149 from guardian/fix/dont-notify-own-messages
Browse files Browse the repository at this point in the history
FIX ensure notifications are not sent back to the author of the message
  • Loading branch information
twrichards committed Aug 10, 2022
2 parents 4f79fae + c034635 commit ce8309a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion notifications-lambda/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ export const handler = async (event: DynamoDBStreamEvent) => {
// TODO: Include more scenarios that trigger desktop notification
(item) =>
isUserMentioned(item, user) ||
doesUserManuallyHavePinboardOpen(item, user)
(item.userEmail !== user.email && // ensure we don't notify the person who sent the message
doesUserManuallyHavePinboardOpen(item, user))
)
.map((item) =>
webPush
Expand Down

0 comments on commit ce8309a

Please sign in to comment.