Skip to content

Commit

Permalink
filter:messaging.send hook
Browse files Browse the repository at this point in the history
  • Loading branch information
psychobunny committed Jul 13, 2016
1 parent 261bef2 commit 67108d1
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/socket.io/modules.js
Expand Up @@ -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('./');
Expand Down Expand Up @@ -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);
},
Expand Down

0 comments on commit 67108d1

Please sign in to comment.