mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-08 06:55:46 +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.filter(function(uid) {
|
||||
return parseInt(uid, 10);
|
||||
uids = uids.filter(function(uid, index, array) {
|
||||
return parseInt(uid, 10) && array.indexOf(uid) === index;
|
||||
});
|
||||
|
||||
if (!uids.length) {
|
||||
|
||||
@@ -73,6 +73,9 @@ module.exports = function(SocketPosts) {
|
||||
admins: function(next) {
|
||||
groups.getMembers('administrators', 0, -1, next);
|
||||
},
|
||||
globalMods: function (next) {
|
||||
groups.getMembers('Global Moderators', 0, -1, next);
|
||||
},
|
||||
moderators: function(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});
|
||||
notifications.push(notification, results.admins.concat(results.moderators), next);
|
||||
notifications.push(notification, results.admins.concat(results.moderators).concat(results.globalMods), next);
|
||||
});
|
||||
}
|
||||
], callback);
|
||||
|
||||
Reference in New Issue
Block a user