[status] home timeline query update

This commit is contained in:
Fosco Marotto 2020-12-27 15:20:42 -05:00
parent 2b3c571422
commit b58f80eb0d

View File

@ -291,7 +291,11 @@ class Status < ApplicationRecord
def as_home_timeline(account)
query = where('created_at > ?', 10.days.ago)
query.where(visibility: [:public, :unlisted, :private])
query.where(visibility: [:public, :unlisted]).or(
where(visibility: [:private]).where('group is null')
).or(
where(visibility: [:private]).where(group: account.groups)
)
query.where(account: [account] + account.following).without_replies
end