From 996cd76baab72b5799f3fccfe0216aaf56d2dca8 Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Sat, 4 May 2019 12:28:00 -0400 Subject: [PATCH] the danger zone --- activity.go | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/activity.go b/activity.go index ad128f7..168a4ca 100644 --- a/activity.go +++ b/activity.go @@ -708,8 +708,23 @@ func jonkjonk(user *WhatAbout, h *Honk) (map[string]interface{}, map[string]inte 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, "
") + if idx == -1 { + jo["summary"] = h.Noise + jo["content"] = "" + } else { + jo["summary"] = h.Noise[:idx] + if strings.HasPrefix(h.Noise[idx+4:], "
") { + 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 {