From 4ce37601a15a7af11d33465d1ae92de26f7fa498 Mon Sep 17 00:00:00 2001 From: Saturnino Abril Date: Sat, 12 May 2018 00:57:20 +0800 Subject: add notification when @user, @here, @all and @channel has colon ":" at the end (#8760) --- app/notification.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'app/notification.go') 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 + } } } -- cgit v1.2.3-1-g7c22