This commit is contained in:
reality 2013-08-24 18:32:52 +00:00
parent c397ba40f4
commit de54ec5c61
2 changed files with 11 additions and 5 deletions

View File

@ -40,7 +40,6 @@ var api = function(dbot) {
} }
}, function(err) { }, function(err) {
if(!err) { if(!err) {
console.log(nicks);
callback(users, nicks); callback(users, nicks);
} }
}); });
@ -48,10 +47,16 @@ var api = function(dbot) {
// Return a user record given a UUID // Return a user record given a UUID
'getUser': function(uuid, callback) { 'getUser': function(uuid, callback) {
this.db.read('users', uuid, function(err, user) { this.db.read('user_redirs', uuid, function(err, id) {
if(err) user = false; if(!err) {
callback(user); this.api.getUser(id, callback);
}); } else {
this.db.read('users', uuid, function(err, user) {
if(err) user = false;
callback(user);
});
}
}.bind(this));
}, },
'resolveChannel': function(server, channelName, callback) { 'resolveChannel': function(server, channelName, callback) {

View File

@ -119,6 +119,7 @@ var commands = function(dbot) {
this.internalAPI.mergeChannelUsers(oldUser, user); this.internalAPI.mergeChannelUsers(oldUser, user);
this.db.del('users', oldUser.id, function(err) { this.db.del('users', oldUser.id, function(err) {
if(!err) { if(!err) {
this.db.save('user_redirs', oldUser.id, user.id, function() {});
this.db.save('users', user.id, user, function(err) { this.db.save('users', user.id, user, function(err) {
if(!err) { if(!err) {
event.reply(dbot.t('merged_users', { event.reply(dbot.t('merged_users', {