action:user.follow and action:user.unfollow

v1.18.x
psychobunny 11 years ago
parent 1036ba4636
commit 0c17ee15f7

@ -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);
}
};

Loading…
Cancel
Save