diff options
author | Harrison Healey <harrisonmhealey@gmail.com> | 2018-04-02 12:40:28 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-02 12:40:28 -0400 |
commit | 088f76ad6e2d10a1c50ef548f2226213271abde3 (patch) | |
tree | 3132588e6b38e7b618e32b81cddf5b08c16450f9 /app/notification.go | |
parent | cffb8918544aaaabbeccd3a84ab5173fee7b18c8 (diff) | |
download | chat-088f76ad6e2d10a1c50ef548f2226213271abde3.tar.gz chat-088f76ad6e2d10a1c50ef548f2226213271abde3.tar.bz2 chat-088f76ad6e2d10a1c50ef548f2226213271abde3.zip |
MM-9868 Fixed mentioning users when followed by multiple periods (#8548)
* MM-9868 Fixed mentioning users when followed by multiple periods
* Added additional unit test
* Added comment to clarify test purpose
Diffstat (limited to 'app/notification.go')
-rw-r--r-- | app/notification.go | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/app/notification.go b/app/notification.go index 181ad4aac..6d0de2223 100644 --- a/app/notification.go +++ b/app/notification.go @@ -892,8 +892,17 @@ func GetExplicitMentions(message string, keywords map[string][]string) *Explicit } // remove trailing '.', as that is the end of a sentence - word = strings.TrimSuffix(word, ".") - if checkForMention(word) { + foundWithSuffix := false + + for strings.HasSuffix(word, ".") { + word = strings.TrimSuffix(word, ".") + if checkForMention(word) { + foundWithSuffix = true + break + } + } + + if foundWithSuffix { continue } |