sometimes the orderedcollection only has items, not ordereditems. sigh.

This commit is contained in:
Ted Unangst 2019-10-10 18:04:42 -04:00
parent aa91c7d96c
commit 0aa072baf2
1 changed files with 11 additions and 6 deletions

View File

@ -295,18 +295,23 @@ func gimmexonks(user *WhatAbout, outbox string) {
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 {