Fix: ドメインブロックがOutboxにおいて動作しない問題 (#491)

This commit is contained in:
KMY(雪あすか) 2024-01-22 08:50:44 +09:00 committed by GitHub
parent 1c09efcf15
commit 96da1fcb00
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 78 additions and 3 deletions

View file

@ -33,7 +33,8 @@ class AccountStatusesFilter
available_visibilities -= [:unlisted] if (domain_block&.detect_invalid_subscription || misskey_software?) && @account.user&.setting_reject_unlisted_subscription
available_visibilities -= [:login] if current_account.nil?
scope.merge!(scope.where(spoiler_text: ['', nil])) if domain_block&.reject_send_sensitive
scope.merge!(scope.where(sensitive: false)) if domain_block&.reject_send_sensitive
scope.merge!(scope.where(searchability: available_searchabilities))
scope.merge!(scope.where(visibility: available_visibilities))
@ -153,9 +154,9 @@ class AccountStatusesFilter
end
def domain_block
return nil if @account.nil? || @account.local?
return nil if @current_account.nil? || @current_account.local?
@domain_block = DomainBlock.find_by(domain: @account.domain)
@domain_block = DomainBlock.find_by(domain: @current_account.domain)
end
def misskey_software?