mirror of
https://github.com/reality/dbot.git
synced 2024-12-28 05:32:50 +01:00
[close #569]
This commit is contained in:
parent
c397ba40f4
commit
de54ec5c61
@ -40,7 +40,6 @@ var api = function(dbot) {
|
||||
}
|
||||
}, function(err) {
|
||||
if(!err) {
|
||||
console.log(nicks);
|
||||
callback(users, nicks);
|
||||
}
|
||||
});
|
||||
@ -48,10 +47,16 @@ var api = function(dbot) {
|
||||
|
||||
// Return a user record given a UUID
|
||||
'getUser': function(uuid, callback) {
|
||||
this.db.read('users', uuid, function(err, user) {
|
||||
if(err) user = false;
|
||||
callback(user);
|
||||
});
|
||||
this.db.read('user_redirs', uuid, function(err, id) {
|
||||
if(!err) {
|
||||
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) {
|
||||
|
@ -119,6 +119,7 @@ var commands = function(dbot) {
|
||||
this.internalAPI.mergeChannelUsers(oldUser, user);
|
||||
this.db.del('users', oldUser.id, function(err) {
|
||||
if(!err) {
|
||||
this.db.save('user_redirs', oldUser.id, user.id, function() {});
|
||||
this.db.save('users', user.id, user, function(err) {
|
||||
if(!err) {
|
||||
event.reply(dbot.t('merged_users', {
|
||||
|
Loading…
Reference in New Issue
Block a user