From 53d0e8653e46c65b16180d95275279edbafb2023 Mon Sep 17 00:00:00 2001 From: Gabe Kangas Date: Thu, 12 Aug 2021 14:30:07 -0700 Subject: [PATCH] Remove old unused function --- core/stats.go | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/core/stats.go b/core/stats.go index d51cf21dc..f74ab8eab 100644 --- a/core/stats.go +++ b/core/stats.go @@ -8,7 +8,6 @@ import ( log "github.com/sirupsen/logrus" "github.com/owncast/owncast/core/data" - "github.com/owncast/owncast/geoip" "github.com/owncast/owncast/models" ) @@ -53,27 +52,6 @@ func IsStreamConnected() bool { return _stats.StreamConnected } -// SetChatClientActive sets a client as active and connected. -func SetChatClientActive(client models.Client) { - l.Lock() - defer l.Unlock() - - // If this clientID already exists then update it. - // Otherwise set a new one. - if existingClient, ok := _stats.ChatClients[client.ClientID]; ok { - existingClient.LastSeen = time.Now() - existingClient.Username = client.Username - existingClient.MessageCount = client.MessageCount - existingClient.Geo = geoip.GetGeoFromIP(existingClient.IPAddress) - _stats.ChatClients[client.ClientID] = existingClient - } else { - if client.Geo == nil { - geoip.FetchGeoForIP(client.IPAddress) - } - _stats.ChatClients[client.ClientID] = client - } -} - // RemoveChatClient removes a client from the active clients record. func RemoveChatClient(clientID string) { log.Trace("Removing the client:", clientID)