[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:
tobi
2022-09-04 14:41:42 +02:00
committed by GitHub
parent 4e13408fd4
commit 006c8b604b
30 changed files with 205 additions and 1039 deletions

View File

@@ -21,6 +21,7 @@ package typeutils
import (
"context"
"net/url"
"sync"
"github.com/superseriousbusiness/activity/streams/vocab"
"github.com/superseriousbusiness/gotosocial/internal/ap"
@@ -195,10 +196,15 @@ type TypeConverter interface {
}
type converter struct {
db db.DB
db db.DB
defaultAvatars []string
randAvatars sync.Map
}
// NewConverter returns a new Converter
func NewConverter(db db.DB) TypeConverter {
return &converter{db: db}
return &converter{
db: db,
defaultAvatars: populateDefaultAvatars(),
}
}