Merge remote-tracking branch 'parent/main' into upstream-20231204

This commit is contained in:
KMY 2023-12-04 12:04:52 +09:00
commit 94c2396a34
179 changed files with 1036 additions and 775 deletions

View file

@ -72,7 +72,7 @@ class BackupService < BaseService
end
def dump_media_attachments!(zipfile)
MediaAttachment.attached.where(account: account).reorder(nil).find_in_batches do |media_attachments|
MediaAttachment.attached.where(account: account).find_in_batches do |media_attachments|
media_attachments.each do |m|
path = m.file&.path
next unless path

View file

@ -43,7 +43,7 @@ class ClearDomainMediaService < BaseService
end
def media_from_blocked_domain
MediaAttachment.joins(:account).merge(blocked_domain_accounts).reorder(nil)
MediaAttachment.joins(:account).merge(blocked_domain_accounts)
end
def emojis_from_blocked_domains

View file

@ -173,7 +173,7 @@ class DeleteAccountService < BaseService
end
def purge_media_attachments!
@account.media_attachments.reorder(nil).find_each do |media_attachment|
@account.media_attachments.find_each do |media_attachment|
next if keep_account_record? && reported_status_ids.include?(media_attachment.status_id)
media_attachment.destroy

View file

@ -50,7 +50,7 @@ class FollowService < BaseService
end
def following_not_possible?
@target_account.nil? || @target_account.id == @source_account.id || @target_account.suspended?
@target_account.nil? || @target_account.id == @source_account.id || @target_account.unavailable?
end
def following_not_allowed?

View file

@ -112,7 +112,7 @@ class NotifyService < BaseService
end
def blocked?
blocked = @recipient.suspended?
blocked = @recipient.unavailable?
blocked ||= from_self? && @notification.type != :poll
return blocked if message? && from_staff?

View file

@ -57,7 +57,7 @@ class ProcessMentionsService < BaseService
# If after resolving it still isn't found or isn't the right
# protocol, then give up
next match if mention_undeliverable?(mentioned_account) || mentioned_account&.suspended?
next match if mention_undeliverable?(mentioned_account) || mentioned_account&.unavailable?
mention = @previous_mentions.find { |x| x.account_id == mentioned_account.id }
mention ||= @current_mentions.find { |x| x.account_id == mentioned_account.id }

View file

@ -12,7 +12,7 @@ class ReportService < BaseService
@rule_ids = options.delete(:rule_ids).presence
@options = options
raise ActiveRecord::RecordNotFound if @target_account.suspended?
raise ActiveRecord::RecordNotFound if @target_account.unavailable?
create_report!
notify_staff!

View file

@ -65,7 +65,7 @@ class SuspendAccountService < BaseService
def privatize_media_attachments!
attachment_names = MediaAttachment.attachment_definitions.keys
@account.media_attachments.reorder(nil).find_each do |media_attachment|
@account.media_attachments.find_each do |media_attachment|
attachment_names.each do |attachment_name|
attachment = media_attachment.public_send(attachment_name)
styles = MediaAttachment::DEFAULT_STYLES | attachment.styles.keys

View file

@ -61,7 +61,7 @@ class UnsuspendAccountService < BaseService
def publish_media_attachments!
attachment_names = MediaAttachment.attachment_definitions.keys
@account.media_attachments.reorder(nil).find_each do |media_attachment|
@account.media_attachments.find_each do |media_attachment|
attachment_names.each do |attachment_name|
attachment = media_attachment.public_send(attachment_name)
styles = MediaAttachment::DEFAULT_STYLES | attachment.styles.keys