sometimes we need to go deeper to find the honk in the bonk
This commit is contained in:
parent
7a332ead41
commit
3ff98a261e
22
activity.go
22
activity.go
|
@ -613,6 +613,14 @@ func xonksaver(user *WhatAbout, item junk.Junk, origin string) *Honk {
|
|||
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 @@ func xonksaver(user *WhatAbout, item junk.Junk, origin string) *Honk {
|
|||
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)
|
||||
}
|
||||
}
|
||||
what = "bonk"
|
||||
case "Update":
|
||||
isUpdate = true
|
||||
|
|
Loading…
Reference in New Issue