Browse Source

Give stream status webhooks an id and timestamp

pull/1309/head
Gabe Kangas 4 years ago
parent
commit
9d0ae44c3c
  1. 5
      core/webhooks/stream.go

5
core/webhooks/stream.go

@ -1,17 +1,22 @@ @@ -1,17 +1,22 @@
package webhooks
import (
"time"
"github.com/owncast/owncast/core/data"
"github.com/owncast/owncast/models"
"github.com/teris-io/shortid"
)
func SendStreamStatusEvent(eventType models.EventType) {
SendEventToWebhooks(WebhookEvent{
Type: eventType,
EventData: map[string]interface{}{
"id": shortid.MustGenerate(),
"name": data.GetServerName(),
"summary": data.GetServerSummary(),
"streamTitle": data.GetStreamTitle(),
"timestamp": time.Now(),
},
})
}

Loading…
Cancel
Save