gab-social/app/services/block_service.rb
mgabdev 4100f3dd63 Removed unused ostatus, activitypub actions from service code
• Removed:
- unused ostatus, activitypub actions from service code
2020-11-09 12:25:14 -06:00

17 lines
553 B
Ruby

# frozen_string_literal: true
class BlockService < BaseService
def call(account, target_account)
return if account.id == target_account.id
UnfollowService.new.call(account, target_account) if account.following?(target_account)
UnfollowService.new.call(target_account, account) if target_account.following?(account)
RejectFollowService.new.call(account, target_account) if target_account.requested?(account)
block = account.block!(target_account)
BlockWorker.perform_async(account.id, target_account.id)
block
end
end