clarify rejected announces correctly

staging
multiple creatures 2019-07-24 20:00:04 -05:00
parent ab43f884e3
commit cf28bbd9fa
1 changed files with 4 additions and 1 deletions

View File

@ -12,7 +12,8 @@ module AutorejectHelper
domain = uri.scan(/[\w\-]+\.[\w\-]+(?:\.[\w\-]+)*/).first
blocks = DomainBlock.suspend
return :domain if blocks.where(domain: domain).or(blocks.where('domain LIKE ?', "%.#{domain}")).exists?
reason = ((@object && @object['type'] == 'Announce') ? :domain_boosted : :domain)
return reason if blocks.where(domain: domain).or(blocks.where('domain LIKE ?', "%.#{domain}")).exists?
return unless @json || @object
@ -60,6 +61,8 @@ module AutorejectHelper
case reason
when :domain
"the origin domain is blocked"
when :domain_boost
"the origin domain of the object being boosted is blocked"
when :id_starts_with
"the object's URI starts with a blocked phrase"
when :id_contains