diff --git a/client/js/lounge.js b/client/js/lounge.js index 1eab796b..f27ff137 100644 --- a/client/js/lounge.js +++ b/client/js/lounge.js @@ -6,6 +6,8 @@ $(function() { var path = window.location.pathname + "socket.io/"; var socket = io({path: path}); var commands = [ + "/away", + "/back", "/close", "/connect", "/deop", @@ -15,6 +17,7 @@ $(function() { "/join", "/kick", "/leave", + "/me", "/mode", "/msg", "/nick", diff --git a/src/client.js b/src/client.js index 77db906b..427751af 100644 --- a/src/client.js +++ b/src/client.js @@ -39,6 +39,7 @@ var inputs = [ "msg", "part", "action", + "away", "connect", "disconnect", "invite", diff --git a/src/plugins/inputs/away.js b/src/plugins/inputs/away.js new file mode 100644 index 00000000..201559fe --- /dev/null +++ b/src/plugins/inputs/away.js @@ -0,0 +1,19 @@ +"use strict"; + +exports.commands = ["away", "back"]; + +exports.input = function(network, chan, cmd, args) { + if (cmd === "away") { + let reason = " "; + + if (args.length > 0) { + reason = args.join(" "); + } + + network.irc.raw("AWAY", reason); + + return; + } + + network.irc.raw("AWAY"); +};