v1.18.x
barisusakli 11 years ago
parent 2d9ca83ae0
commit 42f87a1db7

@ -69,9 +69,8 @@ var
if (err) { if (err) {
return callback(err); return callback(err);
} }
plugins.fireHook('filter:user.removeFields', fieldsToRemove, function(err, fields) {
callback(err, modifyUserData(users, fields)); modifyUserData(users, fieldsToRemove, callback);
});
}); });
}; };
@ -96,13 +95,11 @@ var
return callback(err); return callback(err);
} }
plugins.fireHook('filter:user.removeFields', [], function(err, fields) { modifyUserData(users, [], callback);
callback(err, modifyUserData(users, fields));
});
}); });
}; };
function modifyUserData(users, fieldsToRemove) { function modifyUserData(users, fieldsToRemove, callback) {
users.forEach(function(user) { users.forEach(function(user) {
if (!user) { if (!user) {
return; return;
@ -132,7 +129,8 @@ var
user[fieldsToRemove[i]] = undefined; user[fieldsToRemove[i]] = undefined;
} }
}); });
return users;
plugins.fireHook('filter:users.get', users, callback);
} }
User.updateLastOnlineTime = function(uid, callback) { User.updateLastOnlineTime = function(uid, callback) {

Loading…
Cancel
Save