readd invisible mentions
Ted Unangst tedu@tedunangst.com
Tue, 31 May 2022 00:24:02 -0400
M
honk.go
→
honk.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 {