try to get original audience for remote replies

This commit is contained in:
Ted Unangst 2019-04-11 10:44:50 -04:00
parent 33bf469807
commit 8d966a1d50
2 changed files with 12 additions and 0 deletions

View File

@ -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)

View File

@ -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)