all repos — honk @ 4d654c63d25a3f224b7f947ce07c632dcea43f25

my fork of honk

minimal support for Move activity
Ted Unangst tedu@tedunangst.com
Tue, 24 Dec 2019 08:08:40 -0500
commit

4d654c63d25a3f224b7f947ce07c632dcea43f25

parent

07821ff8e0c3a0c5b907424c404b2993982f80cc

2 files changed, 14 insertions(+), 2 deletions(-)

jump to
M activity.goactivity.go

@@ -36,6 +36,7 @@ "humungus.tedunangst.com/r/webs/cache"

"humungus.tedunangst.com/r/webs/gate" "humungus.tedunangst.com/r/webs/httpsig" "humungus.tedunangst.com/r/webs/junk" + "humungus.tedunangst.com/r/webs/templates" ) var theonetruename = `application/ld+json; profile="https://www.w3.org/ns/activitystreams"`

@@ -465,13 +466,15 @@

xonkxonkfn = func(item junk.Junk, origin string) *Honk { // id, _ := item.GetString( "id") what, _ := item.GetString("type") - dt, _ := item.GetString("published") + dt, ok := item.GetString("published") + if !ok { + dt = time.Now().Format(time.RFC3339) + } var err error var xid, rid, url, content, precis, convoy string var replies []string var obj junk.Junk - var ok bool isUpdate := false switch what { case "Delete":

@@ -572,6 +575,9 @@ }

return xonkxonkfn(obj, originate(xid)) } return nil + case "Move": + obj = item + what = "move" case "Audio": fallthrough case "Video":

@@ -700,6 +706,10 @@ as, _ := a.GetString("name")

content += "<li>" + as } content += "</ul>" + } + if ot == "Move" { + targ, _ := obj.GetString("target") + content += string(templates.Sprintf(`<p>Moved to <a href="%s">%s</a>`, targ, targ)) } if what == "honk" && rid != "" { what = "tonk"
M docs/changelog.txtdocs/changelog.txt

@@ -2,6 +2,8 @@ changelog

=== next ++ Minimal support for Move activity. + ++ Import command now supports the elephant in the room. + deluser command.