about summary refs log tree commit diff
path: root/app/models
diff options
context:
space:
mode:
Diffstat (limited to 'app/models')
-rw-r--r--app/models/admin/status_batch_action.rb4
-rw-r--r--app/models/concerns/account_merging.rb7
-rw-r--r--app/models/instance.rb2
3 files changed, 10 insertions, 3 deletions
diff --git a/app/models/admin/status_batch_action.rb b/app/models/admin/status_batch_action.rb
index 4d91b9805..631af183c 100644
--- a/app/models/admin/status_batch_action.rb
+++ b/app/models/admin/status_batch_action.rb
@@ -68,6 +68,8 @@ class Admin::StatusBatchAction
   end
 
   def handle_mark_as_sensitive!
+    representative_account = Account.representative
+
     # Can't use a transaction here because UpdateStatusService queues
     # Sidekiq jobs
     statuses.includes(:media_attachments, :preview_cards).find_each do |status|
@@ -76,7 +78,7 @@ class Admin::StatusBatchAction
       authorize(status, :update?)
 
       if target_account.local?
-        UpdateStatusService.new.call(status, current_account.id, sensitive: true)
+        UpdateStatusService.new.call(status, representative_account.id, sensitive: true)
       else
         status.update(sensitive: true)
       end
diff --git a/app/models/concerns/account_merging.rb b/app/models/concerns/account_merging.rb
index 119773e6b..8161761fb 100644
--- a/app/models/concerns/account_merging.rb
+++ b/app/models/concerns/account_merging.rb
@@ -15,7 +15,8 @@ module AccountMerging
       Status, StatusPin, MediaAttachment, Poll, Report, Tombstone, Favourite,
       Follow, FollowRequest, Block, Mute,
       AccountModerationNote, AccountPin, AccountStat, ListAccount,
-      PollVote, Mention, AccountDeletionRequest, AccountNote, FollowRecommendationSuppression
+      PollVote, Mention, AccountDeletionRequest, AccountNote, FollowRecommendationSuppression,
+      Appeal
     ]
 
     owned_classes.each do |klass|
@@ -47,6 +48,10 @@ module AccountMerging
       record.update_attribute(:reference_account_id, id)
     end
 
+    Appeal.where(account_warning_id: other_account.id).find_each do |record|
+      record.update_attribute(:account_warning_id, id)
+    end
+
     # Some follow relationships have moved, so the cache is stale
     Rails.cache.delete_matched("followers_hash:#{id}:*")
     Rails.cache.delete_matched("relationships:#{id}:*")
diff --git a/app/models/instance.rb b/app/models/instance.rb
index 7434d3322..c01c23077 100644
--- a/app/models/instance.rb
+++ b/app/models/instance.rb
@@ -33,7 +33,7 @@ class Instance < ApplicationRecord
   end
 
   def unavailable?
-    unavailable_domain.present?
+    unavailable_domain.present? || domain_block&.suspend?
   end
 
   def failing?