all repos — honk @ 720ba7d9d728712b5000a498089c0bcd45640070

my fork of honk

some fixes and changes necessary to support peertube links
Ted Unangst tedu@tedunangst.com
Mon, 01 Jul 2019 10:43:38 -0400
commit

720ba7d9d728712b5000a498089c0bcd45640070

parent

c4e87eac3c839f809460c4778371e18cb12be564

2 files changed, 28 insertions(+), 6 deletions(-)

jump to
M activity.goactivity.go

@@ -419,6 +419,25 @@ }

return a } +func extractattrto(obj junk.Junk) string { + who, _ := obj.GetString("attributedTo") + if who != "" { + return who + } + arr, _ := obj.GetArray("attributedTo") + for _, a := range arr { + o, ok := a.(junk.Junk) + if ok { + t, _ := o.GetString("type") + id, _ := o.GetString("id") + if t == "Person" || t == "" { + return id + } + } + } + return "" +} + func consumeactivity(user *WhatAbout, j junk.Junk, origin string) { xonk := xonkxonk(user, j, origin) if xonk != nil {

@@ -486,6 +505,8 @@ case "Delete":

obj, _ = item.GetMap("object") xid, _ = item.GetString("object") what = "eradicate" + case "Video": + fallthrough case "Question": fallthrough case "Note":

@@ -508,12 +529,14 @@ var xonk Honk

who, _ := item.GetString("actor") if obj != nil { if who == "" { - who, _ = obj.GetString("attributedTo") + who = extractattrto(obj) } - oonker, _ = obj.GetString("attributedTo") + oonker = extractattrto(obj) ot, _ := obj.GetString("type") url, _ = obj.GetString("url") - if ot == "Note" || ot == "Article" || ot == "Page" || ot == "Question" { + if ot == "Tombstone" { + xid, _ = obj.GetString("id") + } else { audience = newphone(audience, obj) xid, _ = obj.GetString("id") precis, _ = obj.GetString("summary")

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

if what == "honk" && rid != "" { what = "tonk" } - } - if ot == "Tombstone" { - xid, _ = obj.GetString("id") } atts, _ := obj.GetArray("attachment") for i, atti := range atts {
M docs/changelog.txtdocs/changelog.txt

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

-- next ++ Minimal support for Video activity and PeerTube compat. + + Support for some user selectable styling. Currently, skinny column mode. + webp image transcoding.