From 778a3b1d790d77a85e771221d544c7fd1c4b837d Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Wed, 6 Nov 2019 21:33:13 -0500 Subject: [PATCH] read avatar option from db --- activity.go | 6 +++++- honk.go | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/activity.go b/activity.go index f598957..4094bdc 100644 --- a/activity.go +++ b/activity.go @@ -1263,7 +1263,11 @@ func junkuser(user *WhatAbout) []byte { a := junk.New() a["type"] = "Image" a["mediaType"] = "image/png" - a["url"] = fmt.Sprintf("https://%s/a?a=%s", serverName, url.QueryEscape(user.URL)) + if ava := user.Options.Avatar; ava != "" { + a["url"] = ava + } else { + a["url"] = fmt.Sprintf("https://%s/a?a=%s", serverName, url.QueryEscape(user.URL)) + } j["icon"] = a } else { j["type"] = "Service" diff --git a/honk.go b/honk.go index f54c6bb..facf14b 100644 --- a/honk.go +++ b/honk.go @@ -46,7 +46,8 @@ type WhatAbout struct { } type UserOptions struct { - SkinnyCSS bool `json:",omitempty"` + SkinnyCSS bool `json:",omitempty"` + Avatar string `json:",omitempty"` } type KeyInfo struct {