Skip to content

Node.js based forum software built for the modern web

send flag notifications to global mods as well

barisusakli87f0d68ba230
diff --git a/src/notifications.js b/src/notifications.js
index 191eaf9e09..cb68e347ff 100644
--- a/src/notifications.js
+++ b/src/notifications.js
@@ -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) {
diff --git a/src/socket.io/posts/flag.js b/src/socket.io/posts/flag.js
index 4bb09470bf..f5febe9ea7 100644
--- a/src/socket.io/posts/flag.js
+++ b/src/socket.io/posts/flag.js
@@ -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);