diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2019-07-08 12:04:06 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-08 12:04:06 +0200 |
commit | ef1524639776fe7d7be2d5c414fc98dd2410a5f4 (patch) | |
tree | ed6cd735b1b0aded08eacaaac3616a45dd59a0f3 /app/controllers | |
parent | 63c7fe8e4892b22e80c015bf0ecb04496318623b (diff) |
Remove unused remote unfollow controller (#11250)
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/remote_unfollows_controller.rb | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/app/controllers/remote_unfollows_controller.rb b/app/controllers/remote_unfollows_controller.rb deleted file mode 100644 index af5943363..000000000 --- a/app/controllers/remote_unfollows_controller.rb +++ /dev/null @@ -1,39 +0,0 @@ -# frozen_string_literal: true - -class RemoteUnfollowsController < ApplicationController - layout 'modal' - - before_action :authenticate_user! - before_action :set_body_classes - - def create - @account = unfollow_attempt.try(:target_account) - - if @account.nil? - render :error - else - render :success - end - rescue ActiveRecord::RecordNotFound, Mastodon::NotPermittedError - render :error - end - - private - - def unfollow_attempt - username, domain = acct_without_prefix.split('@') - UnfollowService.new.call(current_account, Account.find_remote!(username, domain)) - end - - def acct_without_prefix - acct_params.gsub(/\Aacct:/, '') - end - - def acct_params - params.fetch(:acct, '') - end - - def set_body_classes - @body_classes = 'modal-layout' - end -end |