diff --git a/lib/server.js b/lib/server.js index 0475c982..f35004cf 100644 --- a/lib/server.js +++ b/lib/server.js @@ -185,6 +185,41 @@ function handleInput(input) { } 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. // Send raw commands. case "SEND": @@ -271,11 +306,6 @@ function handleEvent(argv) { name: argv.nick }) ); - } else { - var irc = network.irc; - if (typeof irc !== "undefined") { - irc.send("TOPIC", argv.args[0]); - } } messages.add(