Add ZWS into nicknames to prevent unnecessary highlights

main
Robert Gerus 2022-01-07 19:12:04 +01:00
parent fec737b085
commit b1fce1edd7
1 changed files with 12 additions and 1 deletions

View File

@ -7,6 +7,7 @@ import (
"log"
"net"
"net/http"
"strconv"
"time"
"gopkg.in/irc.v3"
@ -38,6 +39,16 @@ func (a *atResponse) UserList() (ret []string) {
return ret
}
func (a *atResponse) UserListZWS() (ret []string) {
x, _ := strconv.Unquote("`\u200B`")
for _, user := range a.Users {
login := user.Login[:1] + x + user.Login[1:]
ret = append(ret, login)
}
return ret
}
func listSubstract(a, b []string) (ret []string) {
mb := make(map[string]bool, len(b))
@ -85,7 +96,7 @@ func (a *atMonitor) Run(c *irc.Client, done chan bool) {
if len(diffText) > 0 {
msg := fmt.Sprintf("NOTICE #hswaw-bottest :%s\n", diffText)
log.println(diffText)
log.Println(diffText)
c.Write(msg)
a.previousUserList = current
}