Merge pull request #458 from thelounge/xpaw/irc-bind

Register irc-framework events before connecting
This commit is contained in:
Alistair McKinlay 2016-07-04 16:14:44 +01:00 committed by GitHub
commit 7ba11b8913
1 changed files with 10 additions and 8 deletions

View File

@ -236,10 +236,20 @@ Client.prototype.connect = function(args) {
} }
network.irc = new ircFramework.Client(); network.irc = new ircFramework.Client();
network.irc.requestCap([ network.irc.requestCap([
"echo-message", "echo-message",
"znc.in/self-message", "znc.in/self-message",
]); ]);
events.forEach(function(plugin) {
var path = "./plugins/irc-events/" + plugin;
require(path).apply(client, [
network.irc,
network
]);
});
network.irc.connect({ network.irc.connect({
version: package.name + " " + package.version + " -- " + package.homepage, version: package.name + " " + package.version + " -- " + package.homepage,
host: network.host, host: network.host,
@ -256,14 +266,6 @@ Client.prototype.connect = function(args) {
auto_reconnect_max_retries: 360, // At least one hour (plus timeouts) worth of reconnections auto_reconnect_max_retries: 360, // At least one hour (plus timeouts) worth of reconnections
webirc: webirc, webirc: webirc,
}); });
events.forEach(function(plugin) {
var path = "./plugins/irc-events/" + plugin;
require(path).apply(client, [
network.irc,
network
]);
});
}; };
Client.prototype.updateToken = function(callback) { Client.prototype.updateToken = function(callback) {