mirror of
https://github.com/thelounge/thelounge
synced 2024-11-22 20:13:07 +00:00
Use double-nick in whois on query to get idle time
This queries server of the other user and not current user, which does not know idle time. See http://superuser.com/a/272069/208074. Override is done before command is being sent to the server: if a single argument is given to `/whois`, it is being repeated, otherwise the command is sent as is.
This commit is contained in:
parent
7ae11babcb
commit
da2e286ff8
2 changed files with 16 additions and 0 deletions
|
@ -52,6 +52,7 @@ var inputs = [
|
|||
"raw",
|
||||
"topic",
|
||||
"list",
|
||||
"whois"
|
||||
].reduce(function(plugins, name) {
|
||||
var path = "./plugins/inputs/" + name;
|
||||
var plugin = require(path);
|
||||
|
|
15
src/plugins/inputs/whois.js
Normal file
15
src/plugins/inputs/whois.js
Normal file
|
@ -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(" ")}`);
|
||||
}
|
||||
};
|
Loading…
Reference in a new issue