mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 19:46:01 +01:00
dont save user obj in db
This commit is contained in:
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user