Clarify in routes and names that it is chat clients being returned

This commit is contained in:
Gabe Kangas 2021-07-21 17:19:15 -07:00
parent 5f322c84f6
commit 2cf761a3f1
3 changed files with 9 additions and 9 deletions

View file

@ -9,8 +9,8 @@ import (
"github.com/owncast/owncast/core/user"
)
// GetConnectedClients returns currently connected clients.
func GetConnectedClients(w http.ResponseWriter, r *http.Request) {
// GetConnectedChatClients returns currently connected clients.
func GetConnectedChatClients(w http.ResponseWriter, r *http.Request) {
clients := chat.GetClients()
w.Header().Set("Content-Type", "application/json")
@ -19,7 +19,7 @@ func GetConnectedClients(w http.ResponseWriter, r *http.Request) {
}
}
// ExternalGetConnectedClients returns currently connected clients.
func ExternalGetConnectedClients(integration user.ExternalAPIUser, w http.ResponseWriter, r *http.Request) {
GetConnectedClients(w, r)
// ExternalGetConnectedChatClients returns currently connected clients.
func ExternalGetConnectedChatClients(integration user.ExternalAPIUser, w http.ResponseWriter, r *http.Request) {
GetConnectedChatClients(w, r)
}

View file

@ -664,7 +664,7 @@ paths:
'200':
$ref: "#/components/responses/BasicResponse"
/api/admin/clients:
/api/admin/chat/clients:
get:
summary: Return a list of currently connected clients
description: Return a list of currently connected clients with optional geo details.

View file

@ -77,8 +77,8 @@ func Start() error {
// Get hardware stats
http.HandleFunc("/api/admin/hardwarestats", middleware.RequireAdminAuth(admin.GetHardwareStats))
// Get a a detailed list of currently connected clients
http.HandleFunc("/api/admin/clients", middleware.RequireAdminAuth(admin.GetConnectedClients))
// Get a a detailed list of currently connected chat clients
http.HandleFunc("/api/admin/chat/clients", middleware.RequireAdminAuth(admin.GetConnectedChatClients))
// Get all logs
http.HandleFunc("/api/admin/logs", middleware.RequireAdminAuth(admin.GetLogs))
@ -167,7 +167,7 @@ func Start() error {
http.HandleFunc("/api/integrations/chat", middleware.RequireExternalAPIAccessToken(user.ScopeHasAdminAccess, controllers.ExternalGetChatMessages))
// Connected clients
http.HandleFunc("/api/integrations/clients", middleware.RequireExternalAPIAccessToken(user.ScopeHasAdminAccess, admin.ExternalGetConnectedClients))
http.HandleFunc("/api/integrations/clients", middleware.RequireExternalAPIAccessToken(user.ScopeHasAdminAccess, admin.ExternalGetConnectedChatClients))
// Logo path
http.HandleFunc("/api/admin/config/logo", middleware.RequireAdminAuth(admin.SetLogo))