From 0c17ee15f74dc548b61903e9f2cd0dbcecf05cd1 Mon Sep 17 00:00:00 2001 From: psychobunny Date: Thu, 14 Aug 2014 17:52:17 -0400 Subject: [PATCH] action:user.follow and action:user.unfollow --- src/socket.io/user.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/socket.io/user.js b/src/socket.io/user.js index 844c2ac270..04a37313db 100644 --- a/src/socket.io/user.js +++ b/src/socket.io/user.js @@ -5,6 +5,7 @@ var async = require('async'), groups = require('../groups'), topics = require('../topics'), messaging = require('../messaging'), + plugins = require('../plugins'), utils = require('./../../public/src/utils'), meta = require('../meta'), SocketUser = {}; @@ -161,12 +162,22 @@ SocketUser.changePicture = function(socket, data, callback) { SocketUser.follow = function(socket, data, callback) { if (socket.uid && data) { + plugins.fireHook('action:user.follow', { + fromUid: socket.uid, + toUid: data.uid + }); + user.follow(socket.uid, data.uid, callback); } }; SocketUser.unfollow = function(socket, data, callback) { if (socket.uid && data) { + plugins.fireHook('action:user.unfollow', { + fromUid: socket.uid, + toUid: data.uid + }); + user.unfollow(socket.uid, data.uid, callback); } };