the danger zone

This commit is contained in:
Ted Unangst 2019-05-04 12:28:00 -04:00
parent 18821eb09b
commit 996cd76baa
1 changed files with 17 additions and 2 deletions

View File

@ -708,8 +708,23 @@ func jonkjonk(user *WhatAbout, h *Honk) (map[string]interface{}, map[string]inte
if len(h.Audience) > 1 { if len(h.Audience) > 1 {
jo["cc"] = h.Audience[1:] jo["cc"] = h.Audience[1:]
} }
jo["content"] = mentionize(h.Noise) if strings.HasPrefix(h.Noise, "DZ:") {
jo["summary"] = nil // 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{} var tags []interface{}
g := bunchofgrapes(h.Noise) g := bunchofgrapes(h.Noise)
for _, m := range g { for _, m := range g {