hardlounge/src/plugins/inputs/quit.js
2014-08-05 00:48:14 -07:00

18 lines
329 B
JavaScript

var _ = require("lodash");
module.exports = function(network, chan, cmd, args) {
if (cmd != "quit" && cmd != "disconnect") {
return;
}
var client = this;
var irc = network.irc;
client.networks = _.without(client.networks, network);
client.emit("quit", {
network: network.id
});
irc.quit();
};