all repos — honk @ 4e677416490459a50a90d3254867b208a2ef0164

my fork of honk

add cc: and link: fields with dark magic to reconfigure honk objects
Ted Unangst tedu@tedunangst.com
Mon, 19 Feb 2024 00:42:10 -0500
commit

4e677416490459a50a90d3254867b208a2ef0164

parent

5e6e2450792800716d0ea4a3e9c59a62cc490d42

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

jump to
M activity.goactivity.go

@@ -1381,7 +1381,14 @@ }

if !h.Public { jo["directMessage"] = true } - h.Noise = re_retag.ReplaceAllString(h.Noise, "") + h.Noise = re_link.ReplaceAllStringFunc(h.Noise, func(x string) string { + link := x[5:] + if link[0] == ' ' { + link = link[1:] + } + h.Link = link + return "" + }) translate(h) redoimages(h) if h.Precis != "" {

@@ -1467,6 +1474,13 @@ jo["duration"] = "PT" + strings.ToUpper(t.Duration.String())

} } atts := activatedonks(h.Donks) + if h.Link != "" { + jo["type"] = "Page" + jl := junk.New() + jl["type"] = "Link" + jl["href"] = h.Link + atts = append(atts, jl) + } if len(atts) > 0 { jo["attachment"] = atts }
M fun.gofun.go

@@ -83,6 +83,7 @@ }

if local && h.What != "bonked" { h.Noise = re_retag.ReplaceAllString(h.Noise, "") h.Noise = re_memes.ReplaceAllString(h.Noise, "") + h.Noise = re_cc.ReplaceAllString(h.Noise, "") } h.Username, h.Handle = handles(h.Honker) if !local {

@@ -371,6 +372,8 @@ }

honk.Donks = honk.Donks[:j] honk.Noise = re_memes.ReplaceAllString(honk.Noise, "") + honk.Noise = re_retag.ReplaceAllString(honk.Noise, "") + honk.Noise = re_cc.ReplaceAllString(honk.Noise, "") honk.Noise = strings.Replace(honk.Noise, "<a href=", "<a class=\"mention u-url\" href=", -1) }

@@ -463,6 +466,8 @@ var re_avatar = regexp.MustCompile("avatar: ?([^\n]+)")

var re_banner = regexp.MustCompile("banner: ?([^\n]+)") var re_convoy = regexp.MustCompile("convoy: ?([^\n]+)") var re_retag = regexp.MustCompile("tags: ?([^\n]+)") +var re_cc = regexp.MustCompile("cc: ?([^\n]+)") +var re_link = regexp.MustCompile("link: ?([^\n]+)") var re_convalidate = regexp.MustCompile("^(https?|tag|data):") func memetize(honk *Honk) {
M honk.gohonk.go

@@ -93,6 +93,7 @@ Donks []*Donk

Onts []string Place *Place Time *Time + Link string Mentions []Mention Badonks []Badonk }