diff --git a/package.json b/package.json index 4a70004f..8b4702fd 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "event-stream": "3.3.2", "express": "4.13.4", "lodash": "4.6.1", - "irc-framework": "1.0.4", + "irc-framework": "1.0.6", "mkdirp": "0.5.1", "moment": "2.12.0", "read": "1.0.7", diff --git a/src/client.js b/src/client.js index 4e3f81e3..3d7a1416 100644 --- a/src/client.js +++ b/src/client.js @@ -338,10 +338,7 @@ Client.prototype.quit = function() { } } this.networks.forEach(function(network) { - var irc = network.irc; - if (irc.connection) { - irc.connection.end(); - } + network.irc.quit("Page closed"); }); }; diff --git a/src/plugins/irc-events/connection.js b/src/plugins/irc-events/connection.js index 18ceb3f2..5635c74a 100644 --- a/src/plugins/irc-events/connection.js +++ b/src/plugins/irc-events/connection.js @@ -13,7 +13,7 @@ module.exports = function(irc, network) { }); irc.on("raw socket connected", function() { - identd.hook(irc.socket, network.username); + identd.hook(irc.connection.socket, network.username); }); irc.on("socket connected", function() { diff --git a/src/plugins/irc-events/error.js b/src/plugins/irc-events/error.js index 9756c9b5..ac01756d 100644 --- a/src/plugins/irc-events/error.js +++ b/src/plugins/irc-events/error.js @@ -2,8 +2,15 @@ var Msg = require("../../models/msg"); module.exports = function(irc, network) { var client = this; + + // TODO: remove later irc.on("irc_error", function(data) { - console.log(data); + console.log("Got an irc_error"); + irc.emit("error", data); + }); + + irc.on("error", function(data) { + console.log("error", data); var text = data.error; if (data.reason) { text = data.reason + " (" + text + ")";