about summary refs log tree commit diff
path: root/app/models
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2019-03-20 17:32:39 +0100
committerThibaut Girka <thib@sitedethib.com>2019-03-20 17:32:39 +0100
commitcbf1d711ba2fab4921bfcf57e7df0b952503f568 (patch)
treea5b928c0da3b018c422b7337708d041bdb9be986 /app/models
parent803c350ef5500229eafce222370c5f97a7532e41 (diff)
parent80f0910e2141b24082b9143266a9a6cf1ef6a516 (diff)
Merge branch 'master' into glitch-soc/merge-upstream
Diffstat (limited to 'app/models')
-rw-r--r--app/models/poll.rb4
-rw-r--r--app/models/status.rb6
2 files changed, 9 insertions, 1 deletions
diff --git a/app/models/poll.rb b/app/models/poll.rb
index 6df230337..8f72c7b11 100644
--- a/app/models/poll.rb
+++ b/app/models/poll.rb
@@ -60,6 +60,10 @@ class Poll < ApplicationRecord
     !local?
   end
 
+  def emojis
+    @emojis ||= CustomEmoji.from_text(options.join(' '), account.domain)
+  end
+
   class Option < ActiveModelSerializers::Model
     attributes :id, :title, :votes_count, :poll
 
diff --git a/app/models/status.rb b/app/models/status.rb
index 95f336820..c049401e8 100644
--- a/app/models/status.rb
+++ b/app/models/status.rb
@@ -218,7 +218,11 @@ class Status < ApplicationRecord
   end
 
   def emojis
-    @emojis ||= CustomEmoji.from_text([spoiler_text, text].join(' '), account.domain)
+    return @emojis if defined?(@emojis)
+    fields = [spoiler_text, text]
+    fields += owned_poll.options unless owned_poll.nil?
+    @emojis = CustomEmoji.from_text(fields.join(' '), account.domain)
+    @emojis
   end
 
   def mark_for_mass_destruction!