Allow forcing /disconnect to stop reconnection timer from running
This commit is contained in:
parent
f3864f8295
commit
211ebbfe5f
@ -3,11 +3,16 @@
|
|||||||
const Helper = require("../../helper");
|
const Helper = require("../../helper");
|
||||||
|
|
||||||
exports.commands = ["disconnect"];
|
exports.commands = ["disconnect"];
|
||||||
|
exports.allowDisconnected = true;
|
||||||
|
|
||||||
exports.input = function(network, chan, cmd, args) {
|
exports.input = function(network, chan, cmd, args) {
|
||||||
const quitMessage = args[0] ? args.join(" ") : Helper.config.leaveMessage;
|
const quitMessage = args[0] ? args.join(" ") : Helper.config.leaveMessage;
|
||||||
|
|
||||||
|
// Even if we are disconnected, but there is an internal connection object
|
||||||
|
// pass the quit/end to it, so the reconnection timer stops
|
||||||
|
if (network.irc && network.irc.connection) {
|
||||||
network.irc.quit(quitMessage);
|
network.irc.quit(quitMessage);
|
||||||
|
}
|
||||||
|
|
||||||
network.userDisconnected = true;
|
network.userDisconnected = true;
|
||||||
this.save();
|
this.save();
|
||||||
|
Loading…
Reference in New Issue
Block a user