From 211ebbfe5f055eb51c72ed9507f8cbc61732e43a Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Wed, 6 Feb 2019 12:10:07 +0200 Subject: [PATCH] Allow forcing /disconnect to stop reconnection timer from running --- src/plugins/inputs/disconnect.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/plugins/inputs/disconnect.js b/src/plugins/inputs/disconnect.js index 6a35be35..db733a44 100644 --- a/src/plugins/inputs/disconnect.js +++ b/src/plugins/inputs/disconnect.js @@ -3,11 +3,16 @@ const Helper = require("../../helper"); exports.commands = ["disconnect"]; +exports.allowDisconnected = true; exports.input = function(network, chan, cmd, args) { const quitMessage = args[0] ? args.join(" ") : Helper.config.leaveMessage; - network.irc.quit(quitMessage); + // 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.userDisconnected = true; this.save();