You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

15 lines
502 B

  1. class UnfollowService < BaseService
  2. # Unfollow and notify the remote user
  3. # @param [Account] source_account Where to unfollow from
  4. # @param [Account] target_account Which to unfollow
  5. def call(source_account, target_account)
  6. follow = source_account.unfollow!(target_account)
  7. send_interaction_service.(follow.stream_entry, target_account) unless target_account.local?
  8. end
  9. private
  10. def send_interaction_service
  11. @send_interaction_service ||= SendInteractionService.new
  12. end
  13. end