Skip to content

Commit

Permalink
Merge pull request thelounge#458 from thelounge/xpaw/irc-bind
Browse files Browse the repository at this point in the history
Register irc-framework events before connecting
  • Loading branch information
AlMcKinlay authored Jul 4, 2016
2 parents 13eb7f5 + 2cdd601 commit 0bf97e5
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,10 +236,20 @@ Client.prototype.connect = function(args) {
}

network.irc = new ircFramework.Client();

network.irc.requestCap([
"echo-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({
version: package.name + " " + package.version + " -- " + package.homepage,
host: network.host,
Expand All @@ -256,14 +266,6 @@ Client.prototype.connect = function(args) {
auto_reconnect_max_retries: 360, // At least one hour (plus timeouts) worth of reconnections
webirc: webirc,
});

events.forEach(function(plugin) {
var path = "./plugins/irc-events/" + plugin;
require(path).apply(client, [
network.irc,
network
]);
});
};

Client.prototype.updateToken = function(callback) {
Expand Down

0 comments on commit 0bf97e5

Please sign in to comment.