mirror of
https://github.com/owncast/owncast.git
synced 2025-11-01 19:32:20 +08:00
This commit is contained in:
@ -19,6 +19,7 @@ import (
|
||||
"github.com/owncast/owncast/models"
|
||||
"github.com/owncast/owncast/utils"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"github.com/teris-io/shortid"
|
||||
)
|
||||
|
||||
// ConfigValue is a container object that holds a value, is encoded, and saved to the database.
|
||||
@ -242,7 +243,7 @@ func SetLogo(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
imgPath := filepath.Join("data", "logo"+extension)
|
||||
if err := os.WriteFile(imgPath, bytes, 0600); err != nil {
|
||||
if err := os.WriteFile(imgPath, bytes, 0o600); err != nil {
|
||||
controllers.WriteSimpleResponse(w, false, err.Error())
|
||||
return
|
||||
}
|
||||
@ -252,6 +253,10 @@ func SetLogo(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
if err := data.SetLogoUniquenessString(shortid.MustGenerate()); err != nil {
|
||||
log.Error("Error saving logo uniqueness string: ", err)
|
||||
}
|
||||
|
||||
// Update Fediverse followers about this change.
|
||||
if err := outbox.UpdateFollowersWithAccountUpdates(); err != nil {
|
||||
controllers.WriteSimpleResponse(w, false, err.Error())
|
||||
|
||||
Reference in New Issue
Block a user