3
0
mirror of https://github.com/reality/dbot.git synced 2024-12-24 11:42:36 +01:00

fix getUser calls

This commit is contained in:
reality 2014-09-04 14:48:20 +00:00
parent c519727b6c
commit e096daa605
5 changed files with 12 additions and 13 deletions

View File

@ -187,7 +187,7 @@ var lastfm = function(dbot) {
.value();
async.each(scrobbliest, function(item, done) {
dbot.api.users.getUser(item.user, function(user) {
dbot.api.users.getUser(item.user, function(err, user) {
item.user = user;
done();
});
@ -327,9 +327,9 @@ var lastfm = function(dbot) {
async.each(tastiest, function(pair, done) {
if(!_.isObject(pair.p1)) { // fix this
dbot.api.users.getUser(pair.p1, function(user) {
dbot.api.users.getUser(pair.p1, function(err, user) {
pair.p1 = user;
dbot.api.users.getUser(pair.p2, function(user) {
dbot.api.users.getUser(pair.p2, function(err, user) {
pair.p2 = user;
done();
});

View File

@ -15,7 +15,7 @@ var pages = function(dbot) {
var voterNicks = [];
async.each(_.keys(poll.votees), function(id, done) {
dbot.api.users.getUser(id, function(user) {
dbot.api.users.getUser(id, function(err, user) {
voterNicks.push(user.primaryNick);
done();
});

View File

@ -7,7 +7,7 @@ var pages = function(dbot) {
var connection = req.params.connection;
var nick = req.params.user;
dbot.api.users.resolveUser(connection, nick, function(user){
dbot.api.users.resolveUser(connection, nick, function(err, user){
if(user){
dbot.api.profile.getProfile(connection, user.primaryNick, function(err, user, profile){
if(!err){
@ -45,7 +45,7 @@ var pages = function(dbot) {
dbot.api.profile.getAllProfiles(function(profiles){
var thumbnails = [];
_.each(profiles, function(profile){
var nick = dbot.api.users.getUser(profile.id, function(user){
var nick = dbot.api.users.getUser(profile.id, function(err, user){
if(user){
/*TODO(@tmenari / @samstudio8)

View File

@ -33,7 +33,7 @@ var pages = function(dbot) {
});
async.eachSeries(userCount, function(userCount, next) {
dbot.api.users.getUser(userCount.id, function(user) {
dbot.api.users.getUser(userCount.id, function(err, user) {
if(user) {
userCount['name'] = user.primaryNick;
users.push(userCount);
@ -72,7 +72,7 @@ var pages = function(dbot) {
});
}.bind(this), function() {
async.each(notifications, function(notify, done) {
dbot.api.users.getUser(notify.user, function(user) {
dbot.api.users.getUser(notify.user, function(err, user) {
if(user) notify.user = user.primaryNick;
done();
});
@ -138,7 +138,7 @@ var pages = function(dbot) {
var pNickCache = {};
async.eachSeries(notifies, function(notify, next) {
if(!_.has(pNickCache, notify.user)) {
dbot.api.users.getUser(notify.user, function(user) {
dbot.api.users.getUser(notify.user, function(err, user) {
pNickCache[notify.user] = user.primaryNick;
notify.user = user.primaryNick;
next();
@ -163,7 +163,7 @@ var pages = function(dbot) {
} else {
var username = req.params.item;
dbot.api.users.resolveUser(server, username, function(user) {
dbot.api.users.resolveUser(server, username, function(err, user) {
this.db.search('notifies', {
'user': user.id
}, function(notify) {

View File

@ -21,7 +21,7 @@ var pages = function(dbot) {
if(!_.include(userIds, warning.warnee)) userIds.push(warning.warnee);
}, function(err) {
async.eachSeries(userIds, function(id, callback) {
dbot.api.users.getUser(id, function(user) {
dbot.api.users.getUser(id, function(err, user) {
userNicks.push(user.primaryNick);
callback(false);
});
@ -47,9 +47,8 @@ var pages = function(dbot) {
}, function(warning) {
warnings.push(warning);
}, function(err) {
console.log(warnings);
async.eachSeries(warnings, function(warning, callback) {
dbot.api.users.getUser(warning.warner, function(user) {
dbot.api.users.getUser(warning.warner, function(err, user) {
warning.warner = user.primaryNick;
callback(false);
});