collect the other replies collection too
Ted Unangst tedu@tedunangst.com
Tue, 26 Dec 2023 15:03:07 -0500
1 files changed,
14 insertions(+),
1 deletions(-)
jump to
M
activity.go
→
activity.go
@@ -376,6 +376,15 @@ }
return nil, false }}) +var gettergate = gate.NewLimiter(1) + +func getsomemore(user *WhatAbout, page string) { + time.Sleep(5 * time.Second) + gettergate.Start() + defer gettergate.Finish() + gimmexonks(user, page) +} + func gimmexonks(user *WhatAbout, outbox string) { dlog.Printf("getting outbox: %s", outbox) j, err := GetJunk(user.ID, outbox)@@ -385,7 +394,7 @@ return
} t, _ := j.GetString("type") origin := originate(outbox) - if t == "OrderedCollection" { + if t == "OrderedCollection" || t == "CollectionPage" { items, _ := j.GetArray("orderedItems") if items == nil { items, _ = j.GetArray("items")@@ -1058,6 +1067,10 @@ if !ok {
first, ok := replyobj.GetMap("first") if ok { items, _ = first.GetArray("items") + next, _ := first.GetString("next") + if next != "" { + go getsomemore(user, next) + } } } for _, repl := range items {