all repos — honk @ 2657bd242c04c2e5f572e488547e9c7a4eb170fc

my fork of honk

allow setting context by hand
Ted Unangst tedu@tedunangst.com
Sat, 25 Mar 2023 14:46:11 -0400
commit

2657bd242c04c2e5f572e488547e9c7a4eb170fc

parent

8b00c0b7d9a4f4548561d1a78251ff47c5a87f39

2 files changed, 13 insertions(+), 1 deletions(-)

jump to
M fun.gofun.go

@@ -425,6 +425,8 @@

var re_memes = regexp.MustCompile("meme: ?([^\n]+)") var re_avatar = regexp.MustCompile("avatar: ?([^\n]+)") var re_banner = regexp.MustCompile("banner: ?([^\n]+)") +var re_convoy = regexp.MustCompile("convoy: ?([^\n]+)") +var re_convalidate = regexp.MustCompile("^(https?|tag|data):") func memetize(honk *Honk) { repl := func(x string) string {
M web.goweb.go

@@ -1612,7 +1612,18 @@ Format: format,

} } + var convoy string noise = strings.Replace(noise, "\r", "", -1) + if updatexid == "" && rid == "" { + noise = re_convoy.ReplaceAllStringFunc(noise, func(m string) string { + convoy = m[7:] + convoy = strings.TrimSpace(convoy) + if !re_convalidate.MatchString(convoy) { + convoy = "" + } + return "" + }) + } noise = quickrename(noise, userinfo.UserID) noise = hooterize(noise) honk.Noise = noise

@@ -1620,7 +1631,6 @@ precipitate(honk)

noise = honk.Noise translate(honk) - var convoy string if rid != "" { xonk := getxonk(userinfo.UserID, rid) if xonk == nil {