all repos — honk @ d0055aa30deba7962c9cfce17cac018bc4d3dd9a

my fork of honk

try processing forwarded creates
Ted Unangst tedu@tedunangst.com
Wed, 28 Feb 2024 03:08:39 -0500
commit

d0055aa30deba7962c9cfce17cac018bc4d3dd9a

parent

06bb4cda6cd19b14bcad2cc9f29e8fb96fc477c9

3 files changed, 21 insertions(+), 11 deletions(-)

jump to
M activity.goactivity.go

@@ -560,6 +560,20 @@ }

return "" } +func grabhonk(user *WhatAbout, xid string) { + if x := getxonk(user.ID, xid); x != nil { + dlog.Printf("already have it: %s", xid) + return + } + var final string + j, err := GetJunkTimeout(user.ID, xid, fastTimeout*time.Second, &final) + if err != nil { + dlog.Printf("unable to fetch xid: %s", err) + return + } + xonksaver(user, j, originate(final)) +} + var re_mast0link = regexp.MustCompile(`https://[[:alnum:].]+/users/[[:alnum:]]+/statuses/[[:digit:]]+`) var re_masto1ink = regexp.MustCompile(`https://([[:alnum:].]+)/@([[:alnum:]]+)(@[[:alnum:].]+)?/([[:digit:]]+)`) var re_misslink = regexp.MustCompile(`https://[[:alnum:].]+/notes/[[:alnum:]]+`)
M syndicate.gosyndicate.go

@@ -23,18 +23,8 @@ return

} reverseItems(rss.Items) for _, item := range rss.Items { - var final string dlog.Printf("link: %s", item.Link) - if x := getxonk(user.ID, item.Link); x != nil { - dlog.Printf("already have it") - continue - } - j, err := GetJunkTimeout(user.ID, item.Link, fastTimeout*time.Second, &final) - if err != nil { - dlog.Printf("unable to fetch link: %s", err) - continue - } - xonksaver(user, j, originate(final)) + grabhonk(user, item.Link) } }
M web.goweb.go

@@ -446,6 +446,12 @@ }

origin := keymatch(keyname, who) if origin == "" { ilog.Printf("keyname actor mismatch: %s <> %s", keyname, who) + if what == "Create" { + if xid, ok := j.GetString("object"); ok { + dlog.Printf("getting forwarded create from %s: %s", keyname, xid) + grabhonk(user, xid) + } + } return }