Add human-readable idle time in whois info
This commit is contained in:
parent
0489d0f2ae
commit
7ae11babcb
@ -33,3 +33,9 @@
|
|||||||
is away <i>({{whois.away}})</i>
|
is away <i>({{whois.away}})</i>
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
{{#if whois.idle}}
|
||||||
|
<div>
|
||||||
|
<span role="button" class="user {{colorClass whois.nick}}" data-name="{{whois.nick}}">{{whois.nick}}</span>
|
||||||
|
has been idle since {{localetime whois.idleTime}}.
|
||||||
|
</div>
|
||||||
|
{{/if}}
|
||||||
|
@ -27,6 +27,9 @@ module.exports = function(irc, network) {
|
|||||||
text: "No such nick: " + data.nick
|
text: "No such nick: " + data.nick
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
// Absolute datetime in milliseconds since nick is idle
|
||||||
|
data.idleTime = Date.now() - data.idle * 1000;
|
||||||
|
|
||||||
msg = new Msg({
|
msg = new Msg({
|
||||||
type: Msg.Type.WHOIS,
|
type: Msg.Type.WHOIS,
|
||||||
whois: data
|
whois: data
|
||||||
|
Loading…
Reference in New Issue
Block a user