dont save user obj in db

v1.18.x
Barış Soner Uşaklı 10 years ago
parent 6acfec9d25
commit 9edfcb0053

@ -281,7 +281,7 @@ SocketUser.follow = function(socket, data, callback) {
if (!socket.uid || !data) { if (!socket.uid || !data) {
return; return;
} }
var userData;
async.waterfall([ async.waterfall([
function(next) { function(next) {
toggleFollow('follow', socket.uid, data.uid, next); toggleFollow('follow', socket.uid, data.uid, next);
@ -289,15 +289,16 @@ SocketUser.follow = function(socket, data, callback) {
function(next) { function(next) {
user.getUserFields(socket.uid, ['username', 'userslug'], next); user.getUserFields(socket.uid, ['username', 'userslug'], next);
}, },
function(userData, next) { function(_userData, next) {
userData = _userData;
notifications.create({ notifications.create({
bodyShort: '[[notifications:user_started_following_you, ' + userData.username + ']]', bodyShort: '[[notifications:user_started_following_you, ' + userData.username + ']]',
nid: 'follow:' + data.uid + ':uid:' + socket.uid, nid: 'follow:' + data.uid + ':uid:' + socket.uid,
from: socket.uid, from: socket.uid
user: userData
}, next); }, next);
}, },
function(notification, next) { function(notification, next) {
notification.user = userData;
notifications.push(notification, [data.uid], next); notifications.push(notification, [data.uid], next);
} }
], callback); ], callback);

Loading…
Cancel
Save