Update irc-framework, fixes quitting networks

This commit is contained in:
Pavel Djundik 2016-03-20 20:03:18 +02:00 committed by Maxime Poulin
parent 769bd16c8b
commit d1da4b338a
4 changed files with 11 additions and 7 deletions

View File

@ -33,7 +33,7 @@
"event-stream": "3.3.2", "event-stream": "3.3.2",
"express": "4.13.4", "express": "4.13.4",
"lodash": "4.6.1", "lodash": "4.6.1",
"irc-framework": "1.0.4", "irc-framework": "1.0.6",
"mkdirp": "0.5.1", "mkdirp": "0.5.1",
"moment": "2.12.0", "moment": "2.12.0",
"read": "1.0.7", "read": "1.0.7",

View File

@ -338,10 +338,7 @@ Client.prototype.quit = function() {
} }
} }
this.networks.forEach(function(network) { this.networks.forEach(function(network) {
var irc = network.irc; network.irc.quit("Page closed");
if (irc.connection) {
irc.connection.end();
}
}); });
}; };

View File

@ -13,7 +13,7 @@ module.exports = function(irc, network) {
}); });
irc.on("raw socket connected", function() { irc.on("raw socket connected", function() {
identd.hook(irc.socket, network.username); identd.hook(irc.connection.socket, network.username);
}); });
irc.on("socket connected", function() { irc.on("socket connected", function() {

View File

@ -2,8 +2,15 @@ var Msg = require("../../models/msg");
module.exports = function(irc, network) { module.exports = function(irc, network) {
var client = this; var client = this;
// TODO: remove later
irc.on("irc_error", function(data) { 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; var text = data.error;
if (data.reason) { if (data.reason) {
text = data.reason + " (" + text + ")"; text = data.reason + " (" + text + ")";