regeneration and database feed generation updates for group posts in feeds
This commit is contained in:
@@ -283,7 +283,13 @@ class Status < ApplicationRecord
|
||||
end
|
||||
|
||||
def as_home_timeline(account)
|
||||
where(account: [account] + account.following).or(where(group: account.groups)).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)
|
||||
|
||||
@@ -213,6 +213,10 @@ class User < ApplicationRecord
|
||||
@shows_application ||= settings.show_application
|
||||
end
|
||||
|
||||
def allows_group_in_home_feed?
|
||||
settings.group_in_home_feed
|
||||
end
|
||||
|
||||
def token_for_app(a)
|
||||
return nil if a.nil? || a.owner != self
|
||||
Doorkeeper::AccessToken
|
||||
@@ -270,6 +274,10 @@ class User < ApplicationRecord
|
||||
setting_display_media == 'hide_all'
|
||||
end
|
||||
|
||||
def force_regeneration!
|
||||
Redis.current.set("account:#{account_id}:regeneration", true)
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def send_devise_notification(notification, *args)
|
||||
|
||||
Reference in New Issue
Block a user