Merge branch 'feature/group-posts-in-timeline' of https://code.gab.com/gab/social/gab-social into develop

This commit is contained in:
Rob Colbert
2019-08-20 19:31:58 -04:00
7 changed files with 49 additions and 1 deletions

View File

@@ -287,7 +287,13 @@ class Status < ApplicationRecord
end
def as_home_timeline(account)
where(account: [account] + account.following).where(visibility: [:public, :unlisted, :private])
query = where(account: [account] + account.following)
if account.user.allows_group_in_home_feed?
query = query.or(where(group: account.groups))
end
query.where(visibility: [:public, :unlisted, :private])
end
def as_group_timeline(group)