Fix #614 - extra reply-boolean on statuses to account for cases when replied-to
status is not in the system at time of distribution; fix #607 - reset privacy settings to defaults when cancelling replies
This commit is contained in:
parent
c424df5192
commit
6331ed16e5
11 changed files with 32 additions and 100 deletions
|
@ -16,8 +16,6 @@ class FeedManager
|
|||
filter_from_home?(status, receiver)
|
||||
elsif timeline_type == :mentions
|
||||
filter_from_mentions?(status, receiver)
|
||||
elsif timeline_type == :public
|
||||
filter_from_public?(status, receiver)
|
||||
else
|
||||
false
|
||||
end
|
||||
|
@ -89,7 +87,9 @@ class FeedManager
|
|||
def filter_from_home?(status, receiver)
|
||||
should_filter = false
|
||||
|
||||
if status.reply? && !status.in_reply_to_account_id.nil? # Filter out if it's a reply
|
||||
if status.reply? && status.in_reply_to_id.nil?
|
||||
should_filter = true
|
||||
elsif status.reply? && !status.in_reply_to_account_id.nil? # Filter out if it's a reply
|
||||
should_filter = !receiver.following?(status.in_reply_to_account) # and I'm not following the person it's a reply to
|
||||
should_filter &&= !(receiver.id == status.in_reply_to_account_id) # and it's not a reply to me
|
||||
should_filter &&= !(status.account_id == status.in_reply_to_account_id) # and it's not a self-reply
|
||||
|
@ -115,17 +115,4 @@ class FeedManager
|
|||
|
||||
should_filter
|
||||
end
|
||||
|
||||
def filter_from_public?(status, receiver)
|
||||
should_filter = receiver.blocking?(status.account)
|
||||
should_filter ||= receiver.blocking?(status.mentions.includes(:account).map(&:account))
|
||||
|
||||
if status.reply? && !status.in_reply_to_account_id.nil?
|
||||
should_filter ||= receiver.blocking?(status.in_reply_to_account)
|
||||
elsif status.reblog?
|
||||
should_filter ||= receiver.blocking?(status.reblog.account)
|
||||
end
|
||||
|
||||
should_filter
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue