Minor bugfix

This commit is contained in:
Mattias Erming 2014-06-19 01:26:28 +02:00
parent 06bd770c9b
commit 8fa145b012
1 changed files with 10 additions and 6 deletions

View File

@ -116,6 +116,16 @@ function connect(params) {
client.nick(params.nick); client.nick(params.nick);
client.user(params.nick, params.realname); client.user(params.nick, params.realname);
events.forEach(function(e) {
client.on(e, function() {
event.apply(network, [e, arguments]);
});
});
if (!params.onConnect) {
return;
}
client.once("welcome", function() { client.once("welcome", function() {
(params.onConnect.join || []).forEach(function(chan) { (params.onConnect.join || []).forEach(function(chan) {
client.join.apply( client.join.apply(
@ -140,12 +150,6 @@ function connect(params) {
delay += 1000; delay += 1000;
}); });
}); });
events.forEach(function(e) {
client.on(e, function() {
event.apply(network, [e, arguments]);
});
});
} }
function auth(password) { function auth(password) {