mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-16 10:46:14 +01:00
wrapping up basic blocking UCP for #6463
This commit is contained in:
@@ -200,4 +200,13 @@ module.exports = function (SocketUser) {
|
||||
},
|
||||
], callback);
|
||||
};
|
||||
|
||||
SocketUser.toggleBlock = function (socket, data, callback) {
|
||||
async.waterfall([
|
||||
async.apply(user.blocks.is, data.uid, socket.uid),
|
||||
function (is, next) {
|
||||
user.blocks[is ? 'remove' : 'add'](data.uid, socket.uid, next);
|
||||
},
|
||||
], callback);
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user