about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
authormultiple creatures <dev@multiple-creature.party>2020-02-14 03:02:05 -0600
committermultiple creatures <dev@multiple-creature.party>2020-02-14 03:06:18 -0600
commit90a3b2199ab470077d9c3bb9c2fe347bfdf8cc10 (patch)
treec27e12cbb1a4d4daf76c8d6f97683f241a2856c0 /app
parent66bfcc17a4c2b1c99707d79b25f2f3a661e0a3d0 (diff)
fix `reject_unknown` policy & graylist federation logic
Diffstat (limited to 'app')
-rw-r--r--app/lib/activitypub/activity/announce.rb2
-rw-r--r--app/lib/activitypub/activity/create.rb4
2 files changed, 4 insertions, 2 deletions
diff --git a/app/lib/activitypub/activity/announce.rb b/app/lib/activitypub/activity/announce.rb
index 2f1a91720..714793d7a 100644
--- a/app/lib/activitypub/activity/announce.rb
+++ b/app/lib/activitypub/activity/announce.rb
@@ -3,7 +3,7 @@
 class ActivityPub::Activity::Announce < ActivityPub::Activity
   def perform
     return if autoreject?
-    return reject_payload! if !@options[:imported] && (delete_arrived_first?(@json['id']) || !related_to_local_activity?)
+    return reject_payload! if !@options[:imported] && (delete_arrived_first?(@json['id']) || !related_to_local_activity? || !@account.known?)
 
     original_status = status_from_object(announced_by: @account)
 
diff --git a/app/lib/activitypub/activity/create.rb b/app/lib/activitypub/activity/create.rb
index 569868c87..a1449a302 100644
--- a/app/lib/activitypub/activity/create.rb
+++ b/app/lib/activitypub/activity/create.rb
@@ -8,8 +8,10 @@ class ActivityPub::Activity::Create < ActivityPub::Activity
     unless known?
       if @options[:announced_by].nil?
         return reject_payload! if !@options[:requested] && rejecting_unknown?
+      elsif Setting.auto_mark_known && known?(@options[:announced_by])
+        @account.mark_known!
       else
-        @account.mark_known! if Setting.auto_mark_known && known?(@options[:announced_by])
+        return reject_payload!
       end
     end