mirror of
https://github.com/thelounge/thelounge
synced 2024-12-24 03:13:08 +00:00
20 lines
440 B
JavaScript
20 lines
440 B
JavaScript
var _ = require("lodash");
|
|
|
|
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 {
|
|
var irc = network.irc;
|
|
if (args.length === 0) {
|
|
args.push(chan.name);
|
|
}
|
|
irc.part(args);
|
|
}
|
|
};
|