From 8fe575dcf35c1d779c390668e016fd41ef8cff82 Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Mon, 20 May 2019 10:51:15 -0400 Subject: [PATCH] reget bonks even when embedded --- activity.go | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/activity.go b/activity.go index 2e24cb0..ff0eb0f 100644 --- a/activity.go +++ b/activity.go @@ -469,18 +469,19 @@ func xonkxonk(user *WhatAbout, item interface{}) *Honk { var ok bool switch what { case "Announce": - xid, ok = jsongetstring(item, "object") + obj, ok = jsongetmap(item, "object") if ok { - if !needxonkid(user, xid) { - return nil - } - log.Printf("getting bonk: %s", xid) - obj, err = GetJunk(xid) - if err != nil { - log.Printf("error regetting: %s", err) - } + xid, _ = jsongetstring(obj, "id") } else { - obj, _ = jsongetmap(item, "object") + xid, _ = jsongetstring(item, "object") + } + if !needxonkid(user, xid) { + return nil + } + log.Printf("getting bonk: %s", xid) + obj, err = GetJunk(xid) + if err != nil { + log.Printf("error regetting: %s", err) } what = "bonk" case "Create":