diff options
author | ThibG <thib@sitedethib.com> | 2019-10-05 18:04:36 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-05 18:04:36 +0200 |
commit | 3921125e5578fb3871fdcae0e8e8a77179f1ad72 (patch) | |
tree | 997c8ed2e7a6b8152266edc0c37ea8264c59d1ab /app/models/status.rb | |
parent | 857c67f31b23b9c496e07eda41755ba449a37f17 (diff) | |
parent | bc8543d9af0045fe2175f7e2234da9c77dc55023 (diff) |
Merge pull request #1228 from ThibG/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/models/status.rb')
-rw-r--r-- | app/models/status.rb | 12 |
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] || [] |