3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-11-13 07:29:30 +01:00

augment whois idle with signon time

This commit is contained in:
Jeremy Latt 2014-02-17 19:56:06 -08:00
parent 9a5f21e78c
commit 528588acfc
2 changed files with 6 additions and 1 deletions

View File

@ -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())
}

View File

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