Fix too many forwards (#5854)
* Avoid sending explicit Undo->Announce when original deleted * Do not forward a reply back to the server that sent it * Deduplicate inboxes of rebloggers' followers for delete forwarding * Adjust test * Fix wrong class, bad SQL, wrong variable, outdated comment
This commit is contained in:
		
					parent
					
						
							
								dc1ebd45a3
							
						
					
				
			
			
				commit
				
					
						85e97ecab6
					
				
			
		
					 6 changed files with 27 additions and 15 deletions
				
			
		|  | @ -30,8 +30,11 @@ class ActivityPub::Activity::Delete < ActivityPub::Activity | |||
|   def forward_for_reblogs(status) | ||||
|     return if @json['signature'].blank? | ||||
| 
 | ||||
|     ActivityPub::RawDistributionWorker.push_bulk(status.reblogs.includes(:account).references(:account).merge(Account.local).pluck(:account_id)) do |account_id| | ||||
|       [payload, account_id] | ||||
|     rebloggers_ids = status.reblogs.includes(:account).references(:account).merge(Account.local).pluck(:account_id) | ||||
|     inboxes        = Account.where(id: ::Follow.where(target_account_id: rebloggers_ids).select(:account_id)).inboxes - [@account.preferred_inbox_url] | ||||
| 
 | ||||
|     ActivityPub::DeliveryWorker.push_bulk(inboxes) do |inbox_url| | ||||
|       [payload, rebloggers_ids.first, inbox_url] | ||||
|     end | ||||
|   end | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue