all repos — honk @ 7106d9354915c211967b578c3bdde8c31677f078

my fork of honk

readd invisible mentions
Ted Unangst tedu@tedunangst.com
Tue, 31 May 2022 00:24:02 -0400
commit

7106d9354915c211967b578c3bdde8c31677f078

parent

f9b8d8accb6aebf12351b5403b7fb0d4b54615b7

2 files changed, 15 insertions(+), 0 deletions(-)

jump to
M fun.gofun.go

@@ -123,6 +123,11 @@ }

h.Precis = demoji(h.Precis) h.Noise = demoji(h.Noise) h.Open = "open" + for _, m := range h.Mentions { + if !strings.Contains(h.Noise, m.Nick()) { + h.Noise = "(" + m.Who + ")" + h.Noise + } + } zap := make(map[string]bool) {
M honk.gohonk.go

@@ -23,6 +23,7 @@ golog "log"

"log/syslog" notrand "math/rand" "os" + "regexp" "strconv" "strings" "time"

@@ -133,6 +134,15 @@

type Mention struct { Who string Where string +} + +var re_firstname = regexp.MustCompile("@[[:alnum:]]+") + +func (mention *Mention) Nick() string { + if m := re_firstname.FindString(mention.Who); m != "" { + return m + } + return mention.Who } type OldRevision struct {