about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
authormultiple creatures <dev@multiple-creature.party>2019-07-24 20:00:04 -0500
committermultiple creatures <dev@multiple-creature.party>2019-07-24 20:00:04 -0500
commitcf28bbd9fa9088a00f954c59fc8edd11e00c3910 (patch)
treece329f08382109092e25f46514e98dc1b2dd5dd1 /app
parentab43f884e34f2ed69455555c0f6ce0d07d8066e4 (diff)
clarify rejected announces correctly
Diffstat (limited to 'app')
-rw-r--r--app/helpers/autoreject_helper.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/app/helpers/autoreject_helper.rb b/app/helpers/autoreject_helper.rb
index e924bb217..3ddbad63d 100644
--- a/app/helpers/autoreject_helper.rb
+++ b/app/helpers/autoreject_helper.rb
@@ -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