* Rewrite Atom generation from stream entries to use Ox instead of Nokogiri::Builder StreamEntry is now limited to only statuses, which allows some optimization. Removed extra queries on AccountsController#show. AtomSerializer instead of AtomBuilderHelper used in AccountsController#show, StreamEntriesController#show, StreamEntryRenderer and PubSubHubbub::DistributionWorker PubSubHubbub::DistributionWorker moves n+1 DomainBlock query to PubSubHubbub::DeliveryWorker instead. All Salmon slaps that aren't based on StreamEntry still use AtomBuilderHelper and Nokogiri * All Salmon slaps now use Ox instead of Nokogiri. No touch from status on account
		
			
				
	
	
		
			16 lines
		
	
	
		
			533 B
		
	
	
	
		
			Ruby
		
	
	
	
	
	
			
		
		
	
	
			16 lines
		
	
	
		
			533 B
		
	
	
	
		
			Ruby
		
	
	
	
	
	
| # frozen_string_literal: true
 | |
| 
 | |
| class AuthorizeFollowService < BaseService
 | |
|   def call(source_account, target_account)
 | |
|     follow_request = FollowRequest.find_by!(account: source_account, target_account: target_account)
 | |
|     follow_request.authorize!
 | |
|     NotificationWorker.perform_async(build_xml(follow_request), target_account.id, source_account.id) unless source_account.local?
 | |
|   end
 | |
| 
 | |
|   private
 | |
| 
 | |
|   def build_xml(follow_request)
 | |
|     AtomSerializer.render(AtomSerializer.new.authorize_follow_request_salmon(follow_request))
 | |
|   end
 | |
| end
 |