mirror of
https://github.com/mattermost/mattermost.git
synced 2026-10-24 23:34:52 +08:00
Fix out-of-channel mentions for usernames with dashes (#7151)
This commit is contained in:
committed by
Harrison Healey
parent
ffbf8e51fe
commit
bbf6c81a06
+5
-3
@@ -828,12 +828,14 @@ func GetExplicitMentions(message string, keywords map[string][]string) (map[stri
|
||||
// Case-sensitive check for first name
|
||||
if ids, match := keywords[splitWord]; match {
|
||||
addMentionedUsers(ids)
|
||||
} else if _, ok := systemMentions[word]; !ok && strings.HasPrefix(word, "@") {
|
||||
username := word[1:len(splitWord)]
|
||||
} else if _, ok := systemMentions[splitWord]; !ok && strings.HasPrefix(splitWord, "@") {
|
||||
username := splitWord[1:]
|
||||
potentialOthersMentioned = append(potentialOthersMentioned, username)
|
||||
}
|
||||
}
|
||||
} else if _, ok := systemMentions[word]; !ok && strings.HasPrefix(word, "@") {
|
||||
}
|
||||
|
||||
if _, ok := systemMentions[word]; !ok && strings.HasPrefix(word, "@") {
|
||||
username := word[1:]
|
||||
potentialOthersMentioned = append(potentialOthersMentioned, username)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user