From 006c8b604b88fdddf1a2319e44aa37dd8777efd9 Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Sun, 4 Sep 2022 14:41:42 +0200 Subject: [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 --- internal/web/profile.go | 16 ---------------- 1 file changed, 16 deletions(-) (limited to 'internal/web/profile.go') diff --git a/internal/web/profile.go b/internal/web/profile.go index 542c015f1..61f7c57e7 100644 --- a/internal/web/profile.go +++ b/internal/web/profile.go @@ -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, -- cgit v1.2.3