From 32bee684078f86057e1c73a327a06a4d0da07f98 Mon Sep 17 00:00:00 2001 From: Jeremy Latt Date: Tue, 11 Dec 2012 23:12:35 -0800 Subject: [PATCH] Track client access time. --- src/irc/client.go | 2 ++ src/irc/server.go | 1 + 2 files changed, 3 insertions(+) diff --git a/src/irc/client.go b/src/irc/client.go index 81bca3e9..993a19e4 100644 --- a/src/irc/client.go +++ b/src/irc/client.go @@ -4,6 +4,7 @@ import ( "fmt" "log" "net" + "time" ) type Client struct { @@ -20,6 +21,7 @@ type Client struct { wallOps bool server *Server channels ChannelSet + atime time.Time } type ClientSet map[*Client]bool diff --git a/src/irc/server.go b/src/irc/server.go index 99c29451..60fcc2db 100644 --- a/src/irc/server.go +++ b/src/irc/server.go @@ -34,6 +34,7 @@ func NewServer(name string) *Server { go func() { for m := range recv { log.Printf("%s -> %T%+v", m.client.Id(), m.message, m.message) + m.client.atime = time.Now() m.message.Handle(server, m.client) } }()