Merge pull request #209 from thelounge/xpaw/no-part
Disallow parting from lobbies
This commit is contained in:
commit
5552c64c3c
@ -1,9 +1,21 @@
|
|||||||
var _ = require("lodash");
|
var _ = require("lodash");
|
||||||
|
var Msg = require("../../models/msg");
|
||||||
|
|
||||||
exports.commands = ["close", "leave", "part"];
|
exports.commands = ["close", "leave", "part"];
|
||||||
|
|
||||||
exports.input = function(network, chan, cmd, args) {
|
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;
|
var irc = network.irc;
|
||||||
if (args.length === 0) {
|
if (args.length === 0) {
|
||||||
args.push(chan.name);
|
args.push(chan.name);
|
||||||
|
Loading…
Reference in New Issue
Block a user