don't go down if we're going up
This commit is contained in:
parent
e89bff3051
commit
16212d9dab
13
activity.go
13
activity.go
|
@ -424,6 +424,7 @@ func xonksaver(user *WhatAbout, item junk.Junk, origin string) *Honk {
|
||||||
depth := 0
|
depth := 0
|
||||||
maxdepth := 10
|
maxdepth := 10
|
||||||
currenttid := ""
|
currenttid := ""
|
||||||
|
goingup := 0
|
||||||
var xonkxonkfn func(item junk.Junk, origin string) *Honk
|
var xonkxonkfn func(item junk.Junk, origin string) *Honk
|
||||||
|
|
||||||
saveonemore := func(xid string) {
|
saveonemore := func(xid string) {
|
||||||
|
@ -712,7 +713,13 @@ func xonksaver(user *WhatAbout, item junk.Junk, origin string) *Honk {
|
||||||
xonk.Onts = oneofakind(xonk.Onts)
|
xonk.Onts = oneofakind(xonk.Onts)
|
||||||
replyobj, ok := obj.GetMap("replies")
|
replyobj, ok := obj.GetMap("replies")
|
||||||
if ok {
|
if ok {
|
||||||
items, _ := replyobj.GetArray("items")
|
items, ok := replyobj.GetArray("items")
|
||||||
|
if !ok {
|
||||||
|
first, ok := replyobj.GetMap("first")
|
||||||
|
if ok {
|
||||||
|
items, _ = first.GetArray("items")
|
||||||
|
}
|
||||||
|
}
|
||||||
for _, repl := range items {
|
for _, repl := range items {
|
||||||
s, ok := repl.(string)
|
s, ok := repl.(string)
|
||||||
if ok {
|
if ok {
|
||||||
|
@ -760,7 +767,9 @@ func xonksaver(user *WhatAbout, item junk.Junk, origin string) *Honk {
|
||||||
} else if needxonk(user, &xonk) {
|
} else if needxonk(user, &xonk) {
|
||||||
if rid != "" {
|
if rid != "" {
|
||||||
if needxonkid(user, rid) {
|
if needxonkid(user, rid) {
|
||||||
|
goingup++
|
||||||
saveonemore(rid)
|
saveonemore(rid)
|
||||||
|
goingup--
|
||||||
}
|
}
|
||||||
if convoy == "" {
|
if convoy == "" {
|
||||||
xx := getxonk(user.ID, rid)
|
xx := getxonk(user.ID, rid)
|
||||||
|
@ -774,12 +783,14 @@ func xonksaver(user *WhatAbout, item junk.Junk, origin string) *Honk {
|
||||||
}
|
}
|
||||||
savexonk(&xonk)
|
savexonk(&xonk)
|
||||||
}
|
}
|
||||||
|
if goingup == 0 {
|
||||||
for _, replid := range replies {
|
for _, replid := range replies {
|
||||||
if needxonkid(user, replid) {
|
if needxonkid(user, replid) {
|
||||||
log.Printf("missing a reply: %s", replid)
|
log.Printf("missing a reply: %s", replid)
|
||||||
saveonemore(replid)
|
saveonemore(replid)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return &xonk
|
return &xonk
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue