update
This commit is contained in:
@@ -3,7 +3,6 @@ package core
|
|||||||
import (
|
import (
|
||||||
"regexp"
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
|
||||||
|
|
||||||
"github.com/beego/beego/v2/adapter/httplib"
|
"github.com/beego/beego/v2/adapter/httplib"
|
||||||
)
|
)
|
||||||
@@ -36,18 +35,9 @@ func (ct *Chat) Push(content interface{}) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var notLock sync.Locker
|
|
||||||
var msgs = map[string]string{}
|
|
||||||
|
|
||||||
func NotifyMasters(content string) {
|
func NotifyMasters(content string) {
|
||||||
go func() {
|
go func() {
|
||||||
content = strings.Trim(content, " ")
|
content = strings.Trim(content, " ")
|
||||||
notLock.Lock()
|
|
||||||
defer notLock.Unlock()
|
|
||||||
if _, ok := msgs[content]; ok {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
msgs[content] = ""
|
|
||||||
if sillyGirl.GetBool("ignore_notify", false) == true {
|
if sillyGirl.GetBool("ignore_notify", false) == true {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user