Add support for editing for published statuses (#16697)
* Add support for editing for published statuses * Fix references to stripped-out code * Various fixes and improvements * Further fixes and improvements * Fix updates being potentially sent to unauthorized recipients * Various fixes and improvements * Fix wrong words in test * Fix notifying accounts that were tagged but were not in the audience * Fix mistake
This commit is contained in:
parent
2d1f082bb6
commit
1060666c58
56 changed files with 1415 additions and 574 deletions
|
@ -25,7 +25,7 @@ class ActivityPub::Activity::Announce < ActivityPub::Activity
|
|||
Trends.tags.register(@status)
|
||||
Trends.links.register(@status)
|
||||
|
||||
distribute(@status)
|
||||
distribute
|
||||
end
|
||||
|
||||
@status
|
||||
|
@ -33,6 +33,22 @@ class ActivityPub::Activity::Announce < ActivityPub::Activity
|
|||
|
||||
private
|
||||
|
||||
def distribute
|
||||
# Notify the author of the original status if that status is local
|
||||
NotifyService.new.call(@status.reblog.account, :reblog, @status) if reblog_of_local_account?(@status) && !reblog_by_following_group_account?(@status)
|
||||
|
||||
# Distribute into home and list feeds
|
||||
::DistributionWorker.perform_async(@status.id) if @options[:override_timestamps] || @status.within_realtime_window?
|
||||
end
|
||||
|
||||
def reblog_of_local_account?(status)
|
||||
status.reblog? && status.reblog.account.local?
|
||||
end
|
||||
|
||||
def reblog_by_following_group_account?(status)
|
||||
status.reblog? && status.account.group? && status.reblog.account.following?(status.account)
|
||||
end
|
||||
|
||||
def audience_to
|
||||
as_array(@json['to']).map { |x| value_or_id(x) }
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue