mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-09 15:35:47 +01:00
send flag notifications to global mods as well
push notifications to unique uids only
This commit is contained in:
@@ -120,8 +120,8 @@ var async = require('async'),
|
|||||||
uids = [uids];
|
uids = [uids];
|
||||||
}
|
}
|
||||||
|
|
||||||
uids = uids.filter(function(uid) {
|
uids = uids.filter(function(uid, index, array) {
|
||||||
return parseInt(uid, 10);
|
return parseInt(uid, 10) && array.indexOf(uid) === index;
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!uids.length) {
|
if (!uids.length) {
|
||||||
|
|||||||
@@ -73,6 +73,9 @@ module.exports = function(SocketPosts) {
|
|||||||
admins: function(next) {
|
admins: function(next) {
|
||||||
groups.getMembers('administrators', 0, -1, next);
|
groups.getMembers('administrators', 0, -1, next);
|
||||||
},
|
},
|
||||||
|
globalMods: function (next) {
|
||||||
|
groups.getMembers('Global Moderators', 0, -1, next);
|
||||||
|
},
|
||||||
moderators: function(next) {
|
moderators: function(next) {
|
||||||
groups.getMembers('cid:' + post.topic.cid + ':privileges:mods', 0, -1, next);
|
groups.getMembers('cid:' + post.topic.cid + ':privileges:mods', 0, -1, next);
|
||||||
}
|
}
|
||||||
@@ -93,7 +96,7 @@ module.exports = function(SocketPosts) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
plugins.fireHook('action:post.flag', {post: post, flaggingUser: flaggingUser});
|
plugins.fireHook('action:post.flag', {post: post, flaggingUser: flaggingUser});
|
||||||
notifications.push(notification, results.admins.concat(results.moderators), next);
|
notifications.push(notification, results.admins.concat(results.moderators).concat(results.globalMods), next);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
], callback);
|
], callback);
|
||||||
|
|||||||
Reference in New Issue
Block a user