Skip to content

Node.js based forum software built for the modern web

filter:sockets.sendNewPostsToUids

psychobunny8f916ed06696
diff --git a/src/socket.io/posts.js b/src/socket.io/posts.js
index e7d5e330d3..d3b772052e 100644
--- a/src/socket.io/posts.js
+++ b/src/socket.io/posts.js
@@ -5,6 +5,7 @@ var async = require('async'),
db = require('../database'),
posts = require('../posts'),
+ plugins = require('../plugins'),
privileges = require('../privileges'),
meta = require('../meta'),
topics = require('../topics'),
@@ -50,11 +51,14 @@ SocketPosts.reply = function(socket, data, callback) {
if (err) {
return;
}
- for(var i=0; i<uids.length; ++i) {
- if (parseInt(uids[i], 10) !== socket.uid) {
- websockets.in('uid_' + uids[i]).emit('event:new_post', result);
+
+ plugins.fireHook('filter:sockets.sendNewPostsToUids', {uidsTo: uids, uidFrom: data.uid}, function(err, uids) {
+ for(var i=0; i<uids.length; ++i) {
+ if (parseInt(uids[i], 10) !== socket.uid) {
+ websockets.in('uid_' + uids[i]).emit('event:new_post', result);
+ }
}
- }
+ });
});
websockets.emitTopicPostStats();