refine the spicy post logic
Ted Unangst tedu@tedunangst.com
Sun, 23 Jun 2019 19:07:28 -0400
2 files changed,
9 insertions(+),
2 deletions(-)
M
activity.go
→
activity.go
@@ -711,7 +711,7 @@
deliverate(0, user.Name, xid, msg) } -var re_spicy = regexp.MustCompile("^(\U0001f336\ufe0f?){3}") +var re_spicy = regexp.MustCompile("^(\U0001f336\ufe0f?){3,}") func jonkjonk(user *WhatAbout, h *Honk) (junk.Junk, junk.Junk) { dt := h.Date.Format(time.RFC3339)@@ -753,9 +753,13 @@ jo["directMessage"] = true
} jo["summary"] = h.Precis jo["content"] = mentionize(h.Noise) - if strings.HasPrefix(h.Precis, "DZ:") || re_spicy.MatchString(h.Noise) { + if strings.HasPrefix(h.Precis, "DZ:") { + jo["sensitive"] = true + } else if peppers := re_spicy.FindString(h.Noise); peppers != "" { + jo["summary"] = peppers jo["sensitive"] = true } + var tags []interface{} g := bunchofgrapes(h.Noise) for _, m := range g {