Added /op, /deop, /voice and /devoice

This commit is contained in:
Mattias Erming 2014-03-14 17:52:24 +01:00
parent 8bedfba27f
commit 6fa95e08dd

View File

@ -185,6 +185,41 @@ function handleInput(input) {
} }
break; break;
case "OP":
case "DEOP":
case "VOICE":
case "DEVOICE":
case "MODE":
var irc = network.irc;
if (!argv[1] && typeof irc === "undefined") {
break;
}
var mode;
var user;
if (cmd != "MODE") {
user = argv[1];
mode = {
"OP": "+o",
"DEOP": "-o",
"VOICE": "+v",
"DEVOICE": "-v"
}[cmd];
} else if (!argv[2]) {
break;
} else {
mode = argv[1];
user = argv[2];
}
irc.send(
"MODE",
target.channel.get("name"),
mode,
user
);
break;
// This command is used for debugging purposes. // This command is used for debugging purposes.
// Send raw commands. // Send raw commands.
case "SEND": case "SEND":
@ -271,11 +306,6 @@ function handleEvent(argv) {
name: argv.nick name: argv.nick
}) })
); );
} else {
var irc = network.irc;
if (typeof irc !== "undefined") {
irc.send("TOPIC", argv.args[0]);
}
} }
messages.add( messages.add(