Include all available whois info

This commit is contained in:
Erik Vosseberg 2017-11-02 12:01:45 +01:00 committed by Jérémie Astori
parent 489bb8e395
commit f40edc7dc2
No known key found for this signature in database
GPG key ID: B9A4F245CD67BDE8
2 changed files with 59 additions and 4 deletions

View file

@ -1,14 +1,62 @@
<div>
{{> ../user_name nick=whois.nick}}
<i class="hostmask">({{whois.user}}@{{whois.host}})</i>:
<b>{{{parse whois.real_name}}}</b>
<i class="hostmask">({{whois.user}}@{{whois.host}})</i>
</div>
{{#if whois.actuallhost}}
<div>
Actual host
{{> ../user_name nick=whois.nick}}
<i class="hostmask">({{whois.user}}@{{whois.actuallhost}})</i>
</div>
{{/if}}
{{#if whois.real_name}}
<div>
{{> ../user_name nick=whois.nick}}'s real name is:
<b>{{parse whois.real_name}}</b>
</div>
{{/if}}
{{#if whois.account}}
<div>
{{> ../user_name nick=whois.nick}}
is logged in as <b>{{whois.account}}</b>
</div>
{{/if}}
{{#if whois.registered_nick}}
<div>
{{> ../user_name nick=whois.nick}}
{{whois.registered_nick}}
</div>
{{/if}}
{{#if whois.modes}}
<div>
{{> ../user_name nick=whois.nick}}
{{whois.modes}}
</div>
{{/if}}
{{#if whois.special}}
<div>
{{> ../user_name nick=whois.nick}}
{{whois.special}}
</div>
{{/if}}
{{#if whois.operator}}
<div>
{{> ../user_name nick=whois.nick}}
{{whois.operator}}
</div>
{{/if}}
{{#if whois.helpop}}
<div>
{{> ../user_name nick=whois.nick}}
is available for help
</div>
{{/if}}
{{#if whois.bot}}
<div>
{{> ../user_name nick=whois.nick}}
is a bot
</div>
{{/if}}
{{#if whois.channels}}
<div>
{{> ../user_name nick=whois.nick}}
@ -33,9 +81,15 @@
is away <i>({{whois.away}})</i>
</div>
{{/if}}
{{#if whois.logonTime}}
<div>
{{> ../user_name nick=whois.nick}}
connected at {{localetime whois.logonTime}}
</div>
{{/if}}
{{#if whois.idle}}
<div>
{{> ../user_name nick=whois.nick}}
has been idle since {{localetime whois.idleTime}}.
has been idle since {{localetime whois.idleTime}}
</div>
{{/if}}

View file

@ -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,