* Change: #375 投稿を編集して拡張ドメインブロックの条件にひっかかる状態になった場合、対象サーバーには投稿削除のActivityを送信する * Fix test * Add test
This commit is contained in:
parent
e4375143ca
commit
fcd13a6474
8 changed files with 146 additions and 12 deletions
|
@ -68,11 +68,7 @@ class PostStatusService < BaseService
|
|||
private
|
||||
|
||||
def preprocess_attributes!
|
||||
@sensitive = (if @options[:sensitive].nil?
|
||||
@media.any? ? @account.user&.setting_default_sensitive : false
|
||||
else
|
||||
@options[:sensitive]
|
||||
end) || @options[:spoiler_text].present?
|
||||
@sensitive = (@options[:sensitive].nil? ? @account.user&.setting_default_sensitive : @options[:sensitive]) || @options[:spoiler_text].present?
|
||||
@text = @options.delete(:spoiler_text) if @text.blank? && @options[:spoiler_text].present?
|
||||
@visibility = @options[:visibility]&.to_sym || @account.user&.setting_default_privacy&.to_sym
|
||||
@visibility = :limited if %w(mutual circle reply).include?(@options[:visibility])
|
||||
|
|
|
@ -24,6 +24,7 @@ class UpdateStatusService < BaseService
|
|||
@account_id = account_id
|
||||
@media_attachments_changed = false
|
||||
@poll_changed = false
|
||||
@old_sensitive = sensitive?
|
||||
|
||||
clear_histories! if @options[:no_history]
|
||||
|
||||
|
@ -189,7 +190,7 @@ class UpdateStatusService < BaseService
|
|||
|
||||
def broadcast_updates!
|
||||
DistributionWorker.perform_async(@status.id, { 'update' => true })
|
||||
ActivityPub::StatusUpdateDistributionWorker.perform_async(@status.id)
|
||||
ActivityPub::StatusUpdateDistributionWorker.perform_async(@status.id, { 'sensitive' => sensitive?, 'sensitive_changed' => @old_sensitive != sensitive? && sensitive? })
|
||||
end
|
||||
|
||||
def queue_poll_notifications!
|
||||
|
@ -227,4 +228,8 @@ class UpdateStatusService < BaseService
|
|||
@status.edited_at = nil
|
||||
@status.save!
|
||||
end
|
||||
|
||||
def sensitive?
|
||||
@status.sensitive
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue