From f7c738dedaf5a12ff37cd5109fd647c24f500401 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Mon, 30 Nov 2020 22:51:33 -0500 Subject: [PATCH] fix: #8997, don't send notifications if uids already in group --- src/groups/invite.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/groups/invite.js b/src/groups/invite.js index 10d56a076b..ad17a36ecf 100644 --- a/src/groups/invite.js +++ b/src/groups/invite.js @@ -51,7 +51,7 @@ module.exports = function (Groups) { Groups.invite = async function (groupName, uids) { uids = Array.isArray(uids) ? uids : [uids]; - await inviteOrRequestMembership(groupName, uids, 'invite'); + uids = await inviteOrRequestMembership(groupName, uids, 'invite'); const notificationData = await Promise.all(uids.map(uid => notifications.create({ type: 'group-invite', @@ -87,6 +87,7 @@ module.exports = function (Groups) { groupName: groupName, uids: uids, }); + return uids; } Groups.isInvited = async function (uids, groupName) {