about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/services/suspend_account_service.rb17
-rw-r--r--app/views/about/_forms.html.haml2
-rw-r--r--app/views/about/_links.html.haml2
3 files changed, 19 insertions, 2 deletions
diff --git a/app/services/suspend_account_service.rb b/app/services/suspend_account_service.rb
index b2ae3a47c..24fa1be69 100644
--- a/app/services/suspend_account_service.rb
+++ b/app/services/suspend_account_service.rb
@@ -41,6 +41,7 @@ class SuspendAccountService < BaseService
     @account = account
     @options = options
 
+    reject_follows!
     purge_user!
     purge_profile!
     purge_content!
@@ -48,6 +49,14 @@ class SuspendAccountService < BaseService
 
   private
 
+  def reject_follows!
+    return if @account.local? || !@account.activitypub?
+
+    ActivityPub::DeliveryWorker.push_bulk(Follow.where(account: @account)) do |follow|
+      [build_reject_json(follow), follow.target_account_id, follow.account.inbox_url]
+    end
+  end
+
   def purge_user!
     return if !@account.local? || @account.user.nil?
 
@@ -120,6 +129,14 @@ class SuspendAccountService < BaseService
     @delete_actor_json = Oj.dump(ActivityPub::LinkedDataSignature.new(payload).sign!(@account))
   end
 
+  def build_reject_json(follow)
+    ActiveModelSerializers::SerializableResource.new(
+      follow,
+      serializer: ActivityPub::RejectFollowSerializer,
+      adapter: ActivityPub::Adapter
+    ).to_json
+  end
+
   def delivery_inboxes
     @delivery_inboxes ||= @account.followers.inboxes + Relay.enabled.pluck(:inbox_url)
   end
diff --git a/app/views/about/_forms.html.haml b/app/views/about/_forms.html.haml
index 81f7173f7..78a422690 100644
--- a/app/views/about/_forms.html.haml
+++ b/app/views/about/_forms.html.haml
@@ -1,7 +1,7 @@
 - if @instance_presenter.open_registrations
   = render 'registration'
 - else
-  = link_to t('auth.register_elsewhere'), 'https://joinmastodon.org', class: 'button button-primary'
+  = link_to t('auth.register_elsewhere'), 'https://joinmastodon.org/#getting-started', class: 'button button-primary'
 
   .closed-registrations-message
     - if @instance_presenter.closed_registrations_message.blank?
diff --git a/app/views/about/_links.html.haml b/app/views/about/_links.html.haml
index f79c37e65..381f301f9 100644
--- a/app/views/about/_links.html.haml
+++ b/app/views/about/_links.html.haml
@@ -11,6 +11,6 @@
         = link_to t('auth.login'), new_user_session_path, class: 'webapp-btn'
     %li= link_to t('about.about_this'), about_more_path
     %li
-      = link_to 'https://joinmastodon.org/' do
+      = link_to 'https://joinmastodon.org/#getting-started' do
         = "#{t('about.other_instances')}"
         %i.fa.fa-external-link{ style: 'padding-left: 5px;' }