// a map of user IDs and when they last were active.
var_lastSeenCache=map[string]time.Time{}
// Server represents an instance of the chat server.
typeServerstruct{
musync.RWMutex
@ -83,11 +86,18 @@ func (s *Server) Addclient(conn *websocket.Conn, user *user.User, accessToken st
@@ -83,11 +86,18 @@ func (s *Server) Addclient(conn *websocket.Conn, user *user.User, accessToken st
ConnectedAt:time.Now(),
}
// Do not send user re-joined broadcast message if they've been active within 5 minutes.
@ -99,7 +109,9 @@ func (s *Server) Addclient(conn *websocket.Conn, user *user.User, accessToken st
@@ -99,7 +109,9 @@ func (s *Server) Addclient(conn *websocket.Conn, user *user.User, accessToken st