all repos — honk @ 5f4a24db03e78c715dafc9399b38bf45694ed699

my fork of honk

sometimes we need to go deeper to find the honk in the bonk
Ted Unangst tedu@tedunangst.com
Sun, 11 Jun 2023 01:40:34 -0400
commit

5f4a24db03e78c715dafc9399b38bf45694ed699

parent

fe5af70bef7b1038649045b5bce20403d5298a03

1 files changed, 17 insertions(+), 5 deletions(-)

jump to
M activity.goactivity.go

@@ -613,6 +613,14 @@ return nil

case "Announce": obj, ok = item.GetMap("object") if ok { + what, ok := obj.GetString("type") + if ok && what == "Create" { + obj, ok = obj.GetMap("object") + if !ok { + ilog.Printf("lost object inside create %s", id) + return nil + } + } xid, _ = obj.GetString("id") } else { xid, _ = item.GetString("object")

@@ -620,12 +628,16 @@ }

if !needbonkid(user, xid) { return nil } - dlog.Printf("getting bonk: %s", xid) - obj, err = GetJunkHardMode(user.ID, xid) - if err != nil { - ilog.Printf("error getting bonk: %s: %s", xid, err) + origin = originate(xid) + if ok && originate(id) == origin { + dlog.Printf("using object in announce for %s", xid) + } else { + dlog.Printf("getting bonk: %s", xid) + obj, err = GetJunkHardMode(user.ID, xid) + if err != nil { + ilog.Printf("error getting bonk: %s: %s", xid, err) + } } - origin = originate(xid) what = "bonk" case "Update": isUpdate = true