all repos — honk @ 3aa89dd22eebf9cc28cf9e8478b54e2f647cdfc1

my fork of honk

oops, working with unicode emoji is a pain. fix spicy meter.
Ted Unangst tedu@tedunangst.com
Thu, 13 Jun 2019 22:22:32 -0400
commit

3aa89dd22eebf9cc28cf9e8478b54e2f647cdfc1

parent

947eb0d64e21e6ec0fc79ef5730826f9b697c112

1 files changed, 5 insertions(+), 1 deletions(-)

jump to
M activity.goactivity.go

@@ -26,6 +26,7 @@ "log"

"net/http" "net/url" "os" + "regexp" "strings" "sync" "time"

@@ -678,6 +679,9 @@

deliverate(0, user.Name, xid, msg) } +var onepepper = string([]byte{0xf0, 0x9f, 0x8c, 0xb6}) +var re_spicy = regexp.MustCompile("^(" + onepepper + "\ufe0f?){3}") + func jonkjonk(user *WhatAbout, h *Honk) (junk.Junk, junk.Junk) { dt := h.Date.Format(time.RFC3339) var jo junk.Junk

@@ -718,7 +722,7 @@ jo["directMessage"] = true

} jo["summary"] = h.Precis jo["content"] = mentionize(h.Noise) - if strings.HasPrefix(h.Precis, "DZ:") || strings.HasPrefix(h.Noise, "🌶️🌶️🌶️") { + if strings.HasPrefix(h.Precis, "DZ:") || re_spicy.MatchString(h.Noise) { jo["sensitive"] = true } var tags []interface{}