From 0b8316d08c8f146200e0e1c5b1dceb50166e2b40 Mon Sep 17 00:00:00 2001 From: Satoshi Nakamoto Date: Wed, 11 Oct 2023 16:07:48 -0400 Subject: [PATCH] Don't create mentions when mentioning yourself By extension, also don't send yourself a push notification when mentioning yourself --- api/resolvers/item.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/api/resolvers/item.js b/api/resolvers/item.js index eb3460bf..01621c60 100644 --- a/api/resolvers/item.js +++ b/api/resolvers/item.js @@ -971,7 +971,9 @@ export const createMentions = async (item, models) => { if (mentions?.length > 0) { const users = await models.user.findMany({ where: { - name: { in: mentions } + name: { in: mentions }, + // Don't create mentions when mentioning yourself + id: { not: item.userId } } })