add notification when @user, @here, @all and @channel has colon ":" at the end (#8760)

Этот коммит содержится в:
Saturnino Abril
2018-05-12 00:57:20 +08:00
коммит произвёл Derrick Anderson
родитель b4db76cedb
Коммит 4ce37601a1
2 изменённых файлов: 59 добавлений и 6 удалений

Просмотреть файл

@@ -919,12 +919,13 @@ func GetExplicitMentions(message string, keywords map[string][]string) *Explicit
// remove trailing '.', as that is the end of a sentence
foundWithSuffix := false
for strings.HasSuffix(word, ".") {
word = strings.TrimSuffix(word, ".")
if checkForMention(word) {
foundWithSuffix = true
break
for _, suffixPunctuation := range []string{".", ":"} {
for strings.HasSuffix(word, suffixPunctuation) {
word = strings.TrimSuffix(word, suffixPunctuation)
if checkForMention(word) {
foundWithSuffix = true
break
}
}
}