diff --git a/app/post_metadata.go b/app/post_metadata.go index f2e8f215d7..44412919b7 100644 --- a/app/post_metadata.go +++ b/app/post_metadata.go @@ -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)...) } diff --git a/app/post_metadata_test.go b/app/post_metadata_test.go index f80faf9d00..8b78470593 100644 --- a/app/post_metadata_test.go +++ b/app/post_metadata_test.go @@ -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",