mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
[feature] Set default header and avatar for API accounts to GtS ones (#799)
* validate web-asset-base-dir * move default icons into converter * always ensure avatar + header on api accounts * update tests * add default header * don't return error from web module creation anymore * tidy a bit * use pngs for default avatars rather than svgs
This commit is contained in:
@ -23,7 +23,6 @@ import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"math/rand"
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
@ -100,21 +99,6 @@ func (m *Module) profileGETHandler(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
// pick a random dummy avatar if this account avatar isn't set yet
|
||||
if account.Avatar == "" && len(m.defaultAvatars) > 0 {
|
||||
//nolint:gosec
|
||||
randomIndex := rand.Intn(len(m.defaultAvatars))
|
||||
dummyAvatar := m.defaultAvatars[randomIndex]
|
||||
account.Avatar = dummyAvatar
|
||||
for _, i := range statusResp.Items {
|
||||
s, ok := i.(*apimodel.Status)
|
||||
if !ok {
|
||||
panic("timelineable was not *apimodel.Status")
|
||||
}
|
||||
s.Account.Avatar = dummyAvatar
|
||||
}
|
||||
}
|
||||
|
||||
c.HTML(http.StatusOK, "profile.tmpl", gin.H{
|
||||
"instance": instance,
|
||||
"account": account,
|
||||
|
Reference in New Issue
Block a user