refactor: centralize avatar URL generation and backfill existing users
This commit is contained in:
11
internal/users/avatar.go
Normal file
11
internal/users/avatar.go
Normal file
@@ -0,0 +1,11 @@
|
||||
package users
|
||||
|
||||
import (
|
||||
"net/url"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func DefaultAvatarURL(username string) string {
|
||||
seed := url.QueryEscape(strings.TrimSpace(username))
|
||||
return "https://api.dicebear.com/9.x/dylan/svg?seed=" + seed
|
||||
}
|
||||
Reference in New Issue
Block a user