make a note of replies we see

This commit is contained in:
Ted Unangst 2019-09-30 23:16:54 -04:00
parent 5efa912126
commit 49a2107fdb
1 changed files with 17 additions and 0 deletions

View File

@ -462,6 +462,7 @@ func xonkxonk(user *WhatAbout, item junk.Junk, origin string) *Honk {
var err error var err error
var xid, rid, url, content, precis, convoy string var xid, rid, url, content, precis, convoy string
var replies []string
var obj junk.Junk var obj junk.Junk
var ok bool var ok bool
isUpdate := false isUpdate := false
@ -722,6 +723,17 @@ func xonkxonk(user *WhatAbout, item junk.Junk, origin string) *Honk {
} }
} }
xonk.Onts = oneofakind(xonk.Onts) xonk.Onts = oneofakind(xonk.Onts)
replyobj, ok := obj.GetMap("replies")
if ok {
items, _ := replyobj.GetArray("items")
for _, repl := range items {
s, ok := repl.(string)
if ok {
replies = append(replies, s)
}
}
}
} }
if originate(xid) != origin { if originate(xid) != origin {
log.Printf("original sin: %s <> %s", xid, origin) log.Printf("original sin: %s <> %s", xid, origin)
@ -776,6 +788,11 @@ func xonkxonk(user *WhatAbout, item junk.Junk, origin string) *Honk {
convoy = currenttid convoy = currenttid
} }
xonk.Convoy = convoy xonk.Convoy = convoy
for _, replid := range replies {
if needxonkid(user, replid) {
log.Printf("missing a reply: %s", replid)
}
}
return &xonk return &xonk
} }
return nil return nil