|
|
@ -1,9 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
'use strict';
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
|
|
|
|
var async = require('async'),
|
|
|
|
var async = require('async');
|
|
|
|
plugins = require('../plugins'),
|
|
|
|
var plugins = require('../plugins');
|
|
|
|
db = require('../database');
|
|
|
|
var db = require('../database');
|
|
|
|
|
|
|
|
|
|
|
|
module.exports = function (User) {
|
|
|
|
module.exports = function (User) {
|
|
|
|
|
|
|
|
|
|
|
@ -73,25 +73,22 @@ module.exports = function (User) {
|
|
|
|
if (!parseInt(uid, 10)) {
|
|
|
|
if (!parseInt(uid, 10)) {
|
|
|
|
return callback(null, []);
|
|
|
|
return callback(null, []);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
async.waterfall([
|
|
|
|
db.getSortedSetRevRange(type + ':' + uid, start, stop, function (err, uids) {
|
|
|
|
function (next) {
|
|
|
|
if (err) {
|
|
|
|
db.getSortedSetRevRange(type + ':' + uid, start, stop, next);
|
|
|
|
return callback(err);
|
|
|
|
},
|
|
|
|
|
|
|
|
function (uids, next) {
|
|
|
|
|
|
|
|
plugins.fireHook('filter:user.' + type, {
|
|
|
|
|
|
|
|
uids: uids,
|
|
|
|
|
|
|
|
uid: uid,
|
|
|
|
|
|
|
|
start: start,
|
|
|
|
|
|
|
|
stop: stop
|
|
|
|
|
|
|
|
}, next);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
function (data, next) {
|
|
|
|
|
|
|
|
User.getUsers(data.uids, uid, next);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
], callback);
|
|
|
|
plugins.fireHook('filter:user.' + type, {
|
|
|
|
|
|
|
|
uids: uids,
|
|
|
|
|
|
|
|
uid: uid,
|
|
|
|
|
|
|
|
start: start,
|
|
|
|
|
|
|
|
stop: stop
|
|
|
|
|
|
|
|
}, function (err, data) {
|
|
|
|
|
|
|
|
if (err) {
|
|
|
|
|
|
|
|
return callback(err);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
User.getUsers(data.uids, uid, callback);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
User.isFollowing = function (uid, theirid, callback) {
|
|
|
|
User.isFollowing = function (uid, theirid, callback) {
|
|
|
|