MM-36127 Check for emojis in message attachment titles (#17943)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
8121ad7512
Коммит
370321a823
@@ -270,6 +270,10 @@ func getEmojiNamesForPost(post *model.Post, reactions []*model.Reaction) []strin
|
|||||||
|
|
||||||
// Post attachments
|
// Post attachments
|
||||||
for _, attachment := range post.Attachments() {
|
for _, attachment := range post.Attachments() {
|
||||||
|
if attachment.Title != "" {
|
||||||
|
names = append(names, getEmojiNamesForString(attachment.Title)...)
|
||||||
|
}
|
||||||
|
|
||||||
if attachment.Text != "" {
|
if attachment.Text != "" {
|
||||||
names = append(names, getEmojiNamesForString(attachment.Text)...)
|
names = append(names, getEmojiNamesForString(attachment.Text)...)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1130,10 +1130,13 @@ func TestGetEmojiNamesForPost(t *testing.T) {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
Title: "This is the title: :emoji5:",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Expected: []string{"emoji1", "emoji2", "emoji3", "emoji4"},
|
Expected: []string{"emoji1", "emoji2", "emoji3", "emoji4", "emoji5"},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Description: "with duplicates",
|
Description: "with duplicates",
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user