summaryrefslogtreecommitdiffstats
path: root/app/notification.go
diff options
context:
space:
mode:
authorSaturnino Abril <saturnino.abril@gmail.com>2018-05-12 00:57:20 +0800
committerDerrick Anderson <derrick@andersonwebstudio.com>2018-05-11 12:57:20 -0400
commit4ce37601a15a7af11d33465d1ae92de26f7fa498 (patch)
treeefc18357bf849d2c308d1cf0e5a5793f3a27bc9b /app/notification.go
parentb4db76cedbd99bfcfb1c12444c5bd84e92ac01dc (diff)
downloadchat-4ce37601a15a7af11d33465d1ae92de26f7fa498.tar.gz
chat-4ce37601a15a7af11d33465d1ae92de26f7fa498.tar.bz2
chat-4ce37601a15a7af11d33465d1ae92de26f7fa498.zip
add notification when @user, @here, @all and @channel has colon ":" at the end (#8760)
Diffstat (limited to 'app/notification.go')
-rw-r--r--app/notification.go13
1 files changed, 7 insertions, 6 deletions
diff --git a/app/notification.go b/app/notification.go
index 7198de764..4bdc6c94f 100644
--- a/app/notification.go
+++ b/app/notification.go
@@ -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
+ }
}
}