mirror of
https://github.com/ergochat/ergo.git
synced 2024-12-22 10:42:52 +01:00
augment whois idle with signon time
This commit is contained in:
parent
9a5f21e78c
commit
528588acfc
@ -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())
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user