From f40edc7dc2b0a701e8e88a925770c7d15c3890c3 Mon Sep 17 00:00:00 2001 From: Erik Vosseberg Date: Thu, 2 Nov 2017 12:01:45 +0100 Subject: [PATCH] Include all available whois info --- client/views/actions/whois.tpl | 60 +++++++++++++++++++++++++++++++-- src/plugins/irc-events/whois.js | 3 +- 2 files changed, 59 insertions(+), 4 deletions(-) diff --git a/client/views/actions/whois.tpl b/client/views/actions/whois.tpl index 78276c40..fac3de64 100644 --- a/client/views/actions/whois.tpl +++ b/client/views/actions/whois.tpl @@ -1,14 +1,62 @@
{{> ../user_name nick=whois.nick}} - ({{whois.user}}@{{whois.host}}): - {{{parse whois.real_name}}} + ({{whois.user}}@{{whois.host}})
+{{#if whois.actuallhost}} +
+ Actual host + {{> ../user_name nick=whois.nick}} + ({{whois.user}}@{{whois.actuallhost}}) +
+{{/if}} +{{#if whois.real_name}} +
+ {{> ../user_name nick=whois.nick}}'s real name is: + {{parse whois.real_name}} +
+{{/if}} {{#if whois.account}}
{{> ../user_name nick=whois.nick}} is logged in as {{whois.account}}
{{/if}} +{{#if whois.registered_nick}} +
+ {{> ../user_name nick=whois.nick}} + {{whois.registered_nick}} +
+{{/if}} +{{#if whois.modes}} +
+ {{> ../user_name nick=whois.nick}} + {{whois.modes}} +
+{{/if}} +{{#if whois.special}} +
+ {{> ../user_name nick=whois.nick}} + {{whois.special}} +
+{{/if}} +{{#if whois.operator}} +
+ {{> ../user_name nick=whois.nick}} + {{whois.operator}} +
+{{/if}} +{{#if whois.helpop}} +
+ {{> ../user_name nick=whois.nick}} + is available for help +
+{{/if}} +{{#if whois.bot}} +
+ {{> ../user_name nick=whois.nick}} + is a bot +
+{{/if}} {{#if whois.channels}}
{{> ../user_name nick=whois.nick}} @@ -33,9 +81,15 @@ is away ({{whois.away}})
{{/if}} +{{#if whois.logonTime}} +
+ {{> ../user_name nick=whois.nick}} + connected at {{localetime whois.logonTime}} +
+{{/if}} {{#if whois.idle}}
{{> ../user_name nick=whois.nick}} - has been idle since {{localetime whois.idleTime}}. + has been idle since {{localetime whois.idleTime}}
{{/if}} diff --git a/src/plugins/irc-events/whois.js b/src/plugins/irc-events/whois.js index 13b41bfa..6747c2ed 100644 --- a/src/plugins/irc-events/whois.js +++ b/src/plugins/irc-events/whois.js @@ -30,7 +30,8 @@ module.exports = function(irc, network) { } else { // Absolute datetime in milliseconds since nick is idle data.idleTime = Date.now() - data.idle * 1000; - + // Absolute datetime in milliseconds when nick logged on. + data.logonTime = data.logon * 1000; msg = new Msg({ type: Msg.Type.WHOIS, whois: data,