about summary refs log tree commit diff
path: root/app/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/admin/accounts_controller.rb14
1 files changed, 12 insertions, 2 deletions
diff --git a/app/controllers/admin/accounts_controller.rb b/app/controllers/admin/accounts_controller.rb
index a62eb6477..f74082562 100644
--- a/app/controllers/admin/accounts_controller.rb
+++ b/app/controllers/admin/accounts_controller.rb
@@ -2,8 +2,8 @@
 
 module Admin
   class AccountsController < BaseController
-    before_action :set_account, only: [:show, :redownload, :remove_avatar, :remove_header, :enable, :mark_known, :mark_unknown, :allow_public, :allow_nonsensitive, :unsilence, :unsuspend, :memorialize, :approve, :reject]
-    before_action :require_remote_account!, only: [:redownload]
+    before_action :set_account, only: [:show, :redownload, :remove_avatar, :remove_header, :enable, :mark_known, :mark_unknown, :allow_public, :allow_nonsensitive, :unsilence, :unsuspend, :memorialize, :approve, :reject, :sync]
+    before_action :require_remote_account!, only: [:redownload, :sync]
     before_action :require_local_account!, only: [:enable, :memorialize, :approve, :reject]
 
     def index
@@ -110,6 +110,16 @@ module Admin
       redirect_to admin_account_path(@account.id)
     end
 
+    def sync
+      authorize @account, :sync?
+
+      @account.update!(last_webfingered_at: nil)
+      ResolveAccountService.new.call(@account)
+      SyncRemoteAccountWorker.perform_async(@account.id)
+
+      redirect_to admin_account_path(@account.id)
+    end
+
     def remove_avatar
       authorize @account, :remove_avatar?