2021-06-20 17:26:35 -07:00
|
|
|
package controllers
|
|
|
|
|
|
|
|
import (
|
|
|
|
"net/http"
|
|
|
|
|
|
|
|
"github.com/owncast/owncast/core"
|
2022-03-06 17:31:47 -08:00
|
|
|
"github.com/owncast/owncast/models"
|
2021-06-20 17:26:35 -07:00
|
|
|
)
|
|
|
|
|
2021-09-12 00:18:15 -07:00
|
|
|
// Ping is fired by a client to show they are still an active viewer.
|
2021-06-20 17:26:35 -07:00
|
|
|
func Ping(w http.ResponseWriter, r *http.Request) {
|
2022-03-06 17:31:47 -08:00
|
|
|
viewer := models.GenerateViewerFromRequest(r)
|
|
|
|
core.SetViewerActive(&viewer)
|
2021-06-20 17:26:35 -07:00
|
|
|
}
|