Trigger the title updated webhook event whenever a title is changed (#2823)
* wip: trigger the title updated webhook event whenever a title is changed * Commit updated API documentation * fix: add STREAM_TITLE_CHANGED to list of valid events * feat: Add support for STREAM_TITLE_CHANGED webhook event on admin dashboard * fix: transmit webhook event after stream has changed to fix race conditions where older title was sent --------- Co-authored-by: Owncast <owncast@owncast.online>
This commit is contained in:
@@ -15,6 +15,7 @@ import (
|
||||
"github.com/owncast/owncast/core/chat"
|
||||
"github.com/owncast/owncast/core/data"
|
||||
"github.com/owncast/owncast/core/user"
|
||||
"github.com/owncast/owncast/core/webhooks"
|
||||
"github.com/owncast/owncast/models"
|
||||
"github.com/owncast/owncast/utils"
|
||||
log "github.com/sirupsen/logrus"
|
||||
@@ -75,6 +76,7 @@ func SetStreamTitle(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
if value != "" {
|
||||
sendSystemChatAction(fmt.Sprintf("Stream title changed to **%s**", value), true)
|
||||
go webhooks.SendStreamStatusEvent(models.StreamTitleUpdated)
|
||||
}
|
||||
controllers.WriteSimpleResponse(w, true, "changed")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user