fix: #8997, don't send notifications if uids already in group

v1.18.x
Barış Soner Uşaklı 4 years ago
parent 1eb5fabdb1
commit f7c738deda

@ -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) {

Loading…
Cancel
Save