From 8d966a1d5027380d3952e178716868226ab5e4ad Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Thu, 11 Apr 2019 10:44:50 -0400 Subject: [PATCH] try to get original audience for remote replies --- activity.go | 9 +++++++++ honk.go | 3 +++ 2 files changed, 12 insertions(+) diff --git a/activity.go b/activity.go index 4e5cb93..f20ae57 100644 --- a/activity.go +++ b/activity.go @@ -327,6 +327,15 @@ func peeppeep() { } } +func whosthere(xid string) []string { + obj, err := GetJunk(xid) + if err != nil { + log.Printf("error getting remote xonk: %s", err) + return nil + } + return newphone(nil, obj) +} + func newphone(a []string, obj map[string]interface{}) []string { for _, addr := range []string{"to", "cc", "attributedTo"} { who, _ := jsongetstring(obj, addr) diff --git a/honk.go b/honk.go index ec80701..ecbdab8 100644 --- a/honk.go +++ b/honk.go @@ -870,6 +870,9 @@ func savehonk(w http.ResponseWriter, r *http.Request) { xonk := getxonk("", rid) if xonk != nil { honk.Audience = append(honk.Audience, xonk.Audience...) + } else { + xonkaud := whosthere(rid) + honk.Audience = append(honk.Audience, xonkaud...) } } honk.Audience = oneofakind(honk.Audience)