diff --git a/src/client.js b/src/client.js index a8270373..ceee4088 100644 --- a/src/client.js +++ b/src/client.js @@ -52,6 +52,7 @@ var inputs = [ "raw", "topic", "list", + "whois" ].reduce(function(plugins, name) { var path = "./plugins/inputs/" + name; var plugin = require(path); diff --git a/src/plugins/inputs/whois.js b/src/plugins/inputs/whois.js new file mode 100644 index 00000000..03573109 --- /dev/null +++ b/src/plugins/inputs/whois.js @@ -0,0 +1,15 @@ +"use strict"; + +exports.commands = ["whois"]; + +exports.input = function(network, chan, cmd, args) { + if (args.length === 1) { + // This queries server of the other user and not of the current user, which + // does not know idle time. + // See http://superuser.com/a/272069/208074. + network.irc.raw("WHOIS", args[0], args[0]); + } else { + // Re-assembling the command parsed in client.js + network.irc.raw(`${cmd} ${args.join(" ")}`); + } +};