readd invisible mentions
This commit is contained in:
parent
61f1cccd88
commit
808925a449
5
fun.go
5
fun.go
|
@ -123,6 +123,11 @@ func reverbolate(userid int64, honks []*Honk) {
|
||||||
h.Precis = demoji(h.Precis)
|
h.Precis = demoji(h.Precis)
|
||||||
h.Noise = demoji(h.Noise)
|
h.Noise = demoji(h.Noise)
|
||||||
h.Open = "open"
|
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)
|
zap := make(map[string]bool)
|
||||||
{
|
{
|
||||||
|
|
10
honk.go
10
honk.go
|
@ -23,6 +23,7 @@ import (
|
||||||
"log/syslog"
|
"log/syslog"
|
||||||
notrand "math/rand"
|
notrand "math/rand"
|
||||||
"os"
|
"os"
|
||||||
|
"regexp"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
@ -135,6 +136,15 @@ type Mention struct {
|
||||||
Where 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 {
|
type OldRevision struct {
|
||||||
Precis string
|
Precis string
|
||||||
Noise string
|
Noise string
|
||||||
|
|
Loading…
Reference in New Issue