From 9deb0489f6114941d4c0b89cbdeeb0dc5eef4736 Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Sun, 20 Mar 2016 18:34:36 +0200 Subject: [PATCH] Disallow parting from lobbies --- src/plugins/inputs/part.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/plugins/inputs/part.js b/src/plugins/inputs/part.js index 7941f55e..49857158 100644 --- a/src/plugins/inputs/part.js +++ b/src/plugins/inputs/part.js @@ -1,9 +1,21 @@ var _ = require("lodash"); +var Msg = require("../../models/msg"); exports.commands = ["close", "leave", "part"]; exports.input = function(network, chan, cmd, args) { - if (chan.type !== "query") { + if (chan.type === "lobby") { + this.emit("msg", { + chan: chan.id, + msg: new Msg({ + type: Msg.Type.ERROR, + text: "You can not part from networks, use /quit instead." + }) + }); + return; + } + + if (chan.type === "channel") { var irc = network.irc; if (args.length === 0) { args.push(chan.name);