some fixes and changes necessary to support peertube links
Ted Unangst tedu@tedunangst.com
Mon, 01 Jul 2019 10:43:38 -0400
2 files changed,
28 insertions(+),
6 deletions(-)
M
activity.go
→
activity.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.txt
→
docs/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.