Fix #30: Close channel on the client as soon as close event is registered
This commit is contained in:
parent
f87d605b53
commit
937126a43e
@ -4,17 +4,15 @@ module.exports = function(network, chan, cmd, args) {
|
||||
if (cmd !== "part" && cmd !== "leave" && cmd !== "close") {
|
||||
return;
|
||||
}
|
||||
var client = this;
|
||||
if (chan.type === "query") {
|
||||
network.channels = _.without(network.channels, chan);
|
||||
client.emit("part", {
|
||||
chan: chan.id
|
||||
});
|
||||
} else {
|
||||
if (chan.type !== "query") {
|
||||
var irc = network.irc;
|
||||
if (args.length === 0) {
|
||||
args.push(chan.name);
|
||||
}
|
||||
irc.part(args);
|
||||
}
|
||||
network.channels = _.without(network.channels, chan);
|
||||
this.emit("part", {
|
||||
chan: chan.id
|
||||
});
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user