From 528588acfcd472bdc2ba5ef07cad4bdc8c49d4b2 Mon Sep 17 00:00:00 2001 From: Jeremy Latt Date: Mon, 17 Feb 2014 19:56:06 -0800 Subject: [PATCH] augment whois idle with signon time --- irc/client.go | 4 ++++ irc/reply.go | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/irc/client.go b/irc/client.go index e5c04463..059cbcbe 100644 --- a/irc/client.go +++ b/irc/client.go @@ -165,6 +165,10 @@ func (client *Client) IdleTime() time.Duration { return time.Since(client.atime) } +func (client *Client) SignonTime() int64 { + return client.ctime.Unix() +} + func (client *Client) IdleSeconds() uint64 { return uint64(client.IdleTime().Seconds()) } diff --git a/irc/reply.go b/irc/reply.go index 1ce42521..2a98a65e 100644 --- a/irc/reply.go +++ b/irc/reply.go @@ -258,7 +258,8 @@ func RplWhoisOperator(client *Client) Reply { func RplWhoisIdle(client *Client) Reply { return NewNumericReply(client.server, RPL_WHOISIDLE, - "%s %d :seconds idle", client.Nick(), client.IdleSeconds()) + "%s %d %d :seconds idle, signon time", + client.Nick(), client.IdleSeconds(), client.SignonTime()) } // TODO check message length