Add "direct" visibility level in the backend. Web UI is not yet
adjusted to allow choosing it, yet
This commit is contained in:
@ -5,7 +5,8 @@ class FanOutOnWriteService < BaseService
|
||||
# @param [Status] status
|
||||
def call(status)
|
||||
deliver_to_self(status) if status.account.local?
|
||||
deliver_to_followers(status)
|
||||
|
||||
status.direct_visibility? ? deliver_to_mentioned_followers(status) : deliver_to_followers(status)
|
||||
|
||||
return if status.account.silenced? || !status.public_visibility? || status.reblog?
|
||||
|
||||
@ -32,6 +33,16 @@ class FanOutOnWriteService < BaseService
|
||||
end
|
||||
end
|
||||
|
||||
def deliver_to_mentioned_followers(status)
|
||||
Rails.logger.debug "Delivering status #{status.id} to mentioned followers"
|
||||
|
||||
status.mentions.includes(:account).each do |mention|
|
||||
mentioned_account = mention.account
|
||||
next if !mentioned_account.local? || !mentioned_account.following?(status.account) || FeedManager.instance.filter?(:home, status, mentioned_account)
|
||||
FeedManager.instance.push(:home, mentioned_account, status)
|
||||
end
|
||||
end
|
||||
|
||||
def deliver_to_hashtags(status)
|
||||
Rails.logger.debug "Delivering status #{status.id} to hashtags"
|
||||
|
||||
|
Reference in New Issue
Block a user