mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-27 17:16:14 +01:00
action:user.follow and action:user.unfollow
This commit is contained in:
@@ -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);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user