mirror of
https://github.com/thelounge/thelounge.git
synced 2024-06-28 10:10:20 +02:00
a3e448acf5
Fixes #1961
26 lines
520 B
JavaScript
26 lines
520 B
JavaScript
"use strict";
|
|
|
|
const _ = require("lodash");
|
|
const Helper = require("../../helper");
|
|
|
|
exports.commands = ["quit"];
|
|
exports.allowDisconnected = true;
|
|
|
|
exports.input = function(network, chan, cmd, args) {
|
|
const client = this;
|
|
|
|
client.networks = _.without(client.networks, network);
|
|
network.destroy();
|
|
client.save();
|
|
client.emit("quit", {
|
|
network: network.id,
|
|
});
|
|
|
|
if (network.irc) {
|
|
const quitMessage = args[0] ? args.join(" ") : Helper.config.leaveMessage;
|
|
network.irc.quit(quitMessage);
|
|
}
|
|
|
|
return true;
|
|
};
|