all repos — honk @ a45d1812fe71c7b50053df1e1c1b670996ebfde0

my fork of honk

sometimes the orderedcollection only has items, not ordereditems. sigh.
Ted Unangst tedu@tedunangst.com
Thu, 10 Oct 2019 18:04:42 -0400
commit

a45d1812fe71c7b50053df1e1c1b670996ebfde0

parent

f39d99994461c4f0b350b29b38008a98b674c8af

1 files changed, 11 insertions(+), 6 deletions(-)

jump to
M activity.goactivity.go

@@ -296,17 +296,22 @@ origin := originate(outbox)

if t == "OrderedCollection" { items, _ := j.GetArray("orderedItems") if items == nil { + items, _ = j.GetArray("items") + } + if items == nil { obj, ok := j.GetMap("first") if ok { items, _ = obj.GetArray("orderedItems") } else { - page1, _ := j.GetString("first") - j, err = GetJunk(page1) - if err != nil { - log.Printf("error gettings page1: %s", err) - return + page1, ok := j.GetString("first") + if ok { + j, err = GetJunk(page1) + if err != nil { + log.Printf("error gettings page1: %s", err) + return + } + items, _ = j.GetArray("orderedItems") } - items, _ = j.GetArray("orderedItems") } } if len(items) > 20 {