Fixes ICU-764
Этот коммит содержится в:
@@ -832,6 +832,9 @@ func GetExplicitMentions(message string, keywords map[string][]string) *Explicit
|
||||
continue
|
||||
}
|
||||
|
||||
// remove trailing '.', as that is the end of a sentence
|
||||
word = strings.TrimSuffix(word, ".")
|
||||
|
||||
if word == "@here" {
|
||||
ret.HereMentioned = true
|
||||
}
|
||||
|
||||
@@ -109,6 +109,15 @@ func TestGetExplicitMentions(t *testing.T) {
|
||||
},
|
||||
},
|
||||
},
|
||||
"OnePersonAtEndOfSentence": {
|
||||
Message: "this is a message for @user.",
|
||||
Keywords: map[string][]string{"@user": {id1}},
|
||||
Expected: &ExplicitMentions{
|
||||
MentionedUserIds: map[string]bool{
|
||||
id1: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
"OnePersonWithoutAtMention": {
|
||||
Message: "this is a message for @user",
|
||||
Keywords: map[string][]string{"this": {id1}},
|
||||
@@ -179,6 +188,15 @@ func TestGetExplicitMentions(t *testing.T) {
|
||||
},
|
||||
},
|
||||
},
|
||||
"UserWithPeriodAtEndOfSentence": {
|
||||
Message: "this is a message for user.period.",
|
||||
Keywords: map[string][]string{"user.period": {id1}},
|
||||
Expected: &ExplicitMentions{
|
||||
MentionedUserIds: map[string]bool{
|
||||
id1: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
"PotentialOutOfChannelUser": {
|
||||
Message: "this is an message for @potential and @user",
|
||||
Keywords: map[string][]string{"@user": {id1}},
|
||||
|
||||
Ссылка в новой задаче
Block a user