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",
"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",

View file

@ -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");
});
};

View file

@ -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() {

View file

@ -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 + ")";