MM-12941: Fixed problem with not-in-channel mentions users (#9974)

Этот коммит содержится в:
Jesús Espino
2018-12-11 14:01:38 +01:00
коммит произвёл GitHub
родитель 32c35e254e
Коммит 5a37a606fc
2 изменённых файлов: 15 добавлений и 1 удалений

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

@@ -486,7 +486,7 @@ func GetExplicitMentions(post *model.Post, keywords map[string][]string) *Explic
foundWithoutSuffix := false
wordWithoutSuffix := word
for strings.LastIndexAny(wordWithoutSuffix, ".-:_") != -1 {
for len(wordWithoutSuffix) > 0 && strings.LastIndexAny(wordWithoutSuffix, ".-:_") == (len(wordWithoutSuffix)-1) {
wordWithoutSuffix = wordWithoutSuffix[0 : len(wordWithoutSuffix)-1]
if checkForMention(wordWithoutSuffix) {