about summary refs log tree commit diff
path: root/app/models/status.rb
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2019-10-03 11:10:12 +0200
committerThibaut Girka <thib@sitedethib.com>2019-10-03 11:10:12 +0200
commita84aedb7a7f050cbf5293351723f55a904992b3a (patch)
tree769d397390665bcddf9b44fc1ad4418b2757c5f1 /app/models/status.rb
parent857c67f31b23b9c496e07eda41755ba449a37f17 (diff)
parentbae268b2f6501ccb0ceeb8dd36180698839c4d3c (diff)
Merge branch 'master' into glitch-soc/merge-upstream
Conflicts:
- app/models/media_attachment.rb
  Upstream raised max image size from 8MB to 10MB while our limit is
  configurable. Raised the default to 10MB.
Diffstat (limited to 'app/models/status.rb')
-rw-r--r--app/models/status.rb12
1 files changed, 7 insertions, 5 deletions
diff --git a/app/models/status.rb b/app/models/status.rb
index 202434db3..7ac0fb5bd 100644
--- a/app/models/status.rb
+++ b/app/models/status.rb
@@ -42,7 +42,7 @@ class Status < ApplicationRecord
   # will be based on current time instead of `created_at`
   attr_accessor :override_timestamps
 
-  update_index('statuses#status', :proper) if Chewy.enabled?
+  update_index('statuses#status', :proper)
 
   enum visibility: [:public, :unlisted, :private, :direct, :limited], _suffix: :visibility
 
@@ -136,12 +136,14 @@ class Status < ApplicationRecord
   REAL_TIME_WINDOW = 6.hours
 
   def searchable_by(preloaded = nil)
-    ids = [account_id]
+    ids = []
+
+    ids << account_id if local?
 
     if preloaded.nil?
-      ids += mentions.pluck(:account_id)
-      ids += favourites.pluck(:account_id)
-      ids += reblogs.pluck(:account_id)
+      ids += mentions.where(account: Account.local).pluck(:account_id)
+      ids += favourites.where(account: Account.local).pluck(:account_id)
+      ids += reblogs.where(account: Account.local).pluck(:account_id)
     else
       ids += preloaded.mentions[id] || []
       ids += preloaded.favourites[id] || []