all repos — honk @ d27b5e87a29c2f14539c1668da9c62d9ea7fc7ed

my fork of honk

the danger zone
Ted Unangst tedu@tedunangst.com
Sat, 04 May 2019 12:28:00 -0400
commit

d27b5e87a29c2f14539c1668da9c62d9ea7fc7ed

parent

eb756078118fa1505e52f35868f6c7efd7fd4264

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

jump to
M activity.goactivity.go

@@ -708,8 +708,23 @@ jo["to"] = h.Audience[0]

if len(h.Audience) > 1 { jo["cc"] = h.Audience[1:] } - jo["content"] = mentionize(h.Noise) - jo["summary"] = nil + if strings.HasPrefix(h.Noise, "DZ:") { + // alas, it's already been turned into html + idx := strings.Index(h.Noise, "<br>") + if idx == -1 { + jo["summary"] = h.Noise + jo["content"] = "" + } else { + jo["summary"] = h.Noise[:idx] + if strings.HasPrefix(h.Noise[idx+4:], "<br>") { + idx += 4 + } + jo["content"] = mentionize(h.Noise[idx+4:]) + } + jo["sensitive"] = true + } else { + jo["content"] = mentionize(h.Noise) + } var tags []interface{} g := bunchofgrapes(h.Noise) for _, m := range g {