mirror of
https://github.com/reality/dbot.git
synced 2024-11-27 22:39:26 +01:00
remove extra JOIN listener in users. derp
This commit is contained in:
parent
0f53693c28
commit
a7b2ba96e7
@ -91,20 +91,6 @@ var users = function(dbot) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
this.listener = function(event) {
|
this.listener = function(event) {
|
||||||
if(event.action == 'JOIN' && event.user != dbot.config.name) {
|
|
||||||
if(!event.rUser) {
|
|
||||||
this.internalAPI.createUser(event.server, event.user, function(user) {
|
|
||||||
this.internalAPI.addChannelUser(event.rChannel, user, {}, function() {});
|
|
||||||
}.bind(this));
|
|
||||||
} else if(!_.include(event.rUser.channels, event.rChannel.id)) {
|
|
||||||
this.internalAPI.addChannelUser(event.rChannel, event.rUser, {}, function() {});
|
|
||||||
}
|
|
||||||
|
|
||||||
if(event.rUser.currentNick != event.user) {
|
|
||||||
event.rUser.currentNick = event.user;
|
|
||||||
this.db.save('users', event.rUser.id, event.rUser, function() {});
|
|
||||||
}
|
|
||||||
} else if(event.action == 'NICK') {
|
|
||||||
this.api.isKnownUser(event.server, event.newNick, function(isKnown) {
|
this.api.isKnownUser(event.server, event.newNick, function(isKnown) {
|
||||||
event.rUser.currentNick = event.newNick;
|
event.rUser.currentNick = event.newNick;
|
||||||
|
|
||||||
@ -116,9 +102,8 @@ var users = function(dbot) {
|
|||||||
dbot.api.event.emit('new_user_alias', [ event.rUser, event.newNick ]);
|
dbot.api.event.emit('new_user_alias', [ event.rUser, event.newNick ]);
|
||||||
});
|
});
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
}
|
|
||||||
}.bind(this);
|
}.bind(this);
|
||||||
this.on = ['JOIN', 'NICK'];
|
this.on = ['NICK'];
|
||||||
|
|
||||||
this.onLoad = function() {
|
this.onLoad = function() {
|
||||||
dbot.instance.addPreEmitHook(function(event, callback) {
|
dbot.instance.addPreEmitHook(function(event, callback) {
|
||||||
|
Loading…
Reference in New Issue
Block a user