about summary refs log tree commit diff
path: root/app/models
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2022-03-31 10:42:51 +0200
committerGitHub <noreply@github.com>2022-03-31 10:42:51 +0200
commit3381a0e6e050438680f38c97ac9332045b8d66f4 (patch)
treef64333019509573bec9799648217d8aa22fca166 /app/models
parent363773d0e9ffa9f4efc564603327f225193a2bf1 (diff)
parent6bdec0aec967c5c64e46136f73666c4a67d5a641 (diff)
Merge pull request #1729 from ClearlyClaire/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/models')
-rw-r--r--app/models/status.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/app/models/status.rb b/app/models/status.rb
index 62f9e5831..9eaf85668 100644
--- a/app/models/status.rb
+++ b/app/models/status.rb
@@ -160,6 +160,15 @@ class Status < ApplicationRecord
     ids.uniq
   end
 
+  def searchable_text
+    [
+      spoiler_text,
+      FormattingHelper.extract_status_plain_text(self),
+      preloadable_poll ? preloadable_poll.options.join("\n\n") : nil,
+      ordered_media_attachments.map(&:description).join("\n\n"),
+    ].compact.join("\n\n")
+  end
+
   def reply?
     !in_reply_to_id.nil? || attributes['reply']
   end