Add conversation-based forwarding for limited visibility statuses through bearcaps

This commit is contained in:
Eugen Rochko 2020-08-26 03:16:47 +02:00
parent 52157fdcba
commit 7cd4ed7d42
26 changed files with 430 additions and 78 deletions

View file

@ -42,9 +42,21 @@ class ProcessMentionsService < BaseService
"@#{mentioned_account.acct}"
end
if status.limited_visibility? && status.thread&.limited_visibility?
# If we are replying to a local status, then we'll have the complete
# audience copied here, both local and remote. If we are replying
# to a remote status, only local audience will be copied. Then we
# need to send our reply to the remote author's inbox for distribution
status.thread.mentions.includes(:account).find_each do |mention|
status.mentions.create(silent: true, account: mention.account)
end
end
status.save!
check_for_spam(status)
# Silent mentions need to be delivered separately
mentions.each { |mention| create_notification(mention) }
end