From 0aa072baf236f455a7a5756515a5486a0bb6bad7 Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Thu, 10 Oct 2019 18:04:42 -0400 Subject: [PATCH] sometimes the orderedcollection only has items, not ordereditems. sigh. --- activity.go | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/activity.go b/activity.go index 8f1bb43..65e45bb 100644 --- a/activity.go +++ b/activity.go @@ -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 {