Skip to content

Commit

Permalink
Allow forcing /disconnect to stop reconnection timer from running
Browse files Browse the repository at this point in the history
  • Loading branch information
xPaw committed Feb 6, 2019
1 parent f3864f8 commit 211ebbf
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/plugins/inputs/disconnect.js
Expand Up @@ -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();
Expand Down

0 comments on commit 211ebbf

Please sign in to comment.