Node.js based forum software built for the modern web
filter:messaging.send hook
psychobunny67108d1c4165
diff --git a/src/socket.io/modules.js b/src/socket.io/modules.jsindex ebd27730e4..f76e8f9646 100644--- a/src/socket.io/modules.js+++ b/src/socket.io/modules.js@@ -5,6 +5,7 @@ var validator = require('validator');var meta = require('../meta');var notifications = require('../notifications');+var plugins = require('../plugins');var Messaging = require('../messaging');var utils = require('../../public/src/utils');var server = require('./');@@ -86,6 +87,15 @@ SocketModules.chats.send = function(socket, data, callback) {}async.waterfall([+ function (next) {+ plugins.fireHook('filter:messaging.send', {+ data: data,+ uid: socket.uid+ }, function(err, results) {+ data = results.data;+ next(err);+ });+ },function (next) {Messaging.canMessageRoom(socket.uid, data.roomId, next);},