MM-36127 Check for emojis in message attachment titles (#17943)

Этот коммит содержится в:
Harrison Healey
2021-08-02 14:23:10 -04:00
коммит произвёл GitHub
родитель 8121ad7512
Коммит 370321a823
2 изменённых файлов: 8 добавлений и 1 удалений

Просмотреть файл

@@ -270,6 +270,10 @@ func getEmojiNamesForPost(post *model.Post, reactions []*model.Reaction) []strin
// Post attachments
for _, attachment := range post.Attachments() {
if attachment.Title != "" {
names = append(names, getEmojiNamesForString(attachment.Title)...)
}
if 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",