about summary refs log tree commit diff
path: root/app/lib/activitypub/activity.rb
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2019-02-17 03:38:25 +0100
committerGitHub <noreply@github.com>2019-02-17 03:38:25 +0100
commit147b4c2c3afacd6ad9d5c1353c072861eaca5fd2 (patch)
treef1e7cc90285e97715ab6aae25abc4e5165c3100b /app/lib/activitypub/activity.rb
parent041ff5fa9a45f7b8d1048a05a35611622b6f5fdb (diff)
Add logging for rejected ActivityPub payloads and add tests (#10062)
Diffstat (limited to 'app/lib/activitypub/activity.rb')
-rw-r--r--app/lib/activitypub/activity.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/lib/activitypub/activity.rb b/app/lib/activitypub/activity.rb
index 3cf38764a..8265810a0 100644
--- a/app/lib/activitypub/activity.rb
+++ b/app/lib/activitypub/activity.rb
@@ -180,4 +180,9 @@ class ActivityPub::Activity
   def requested_through_relay?
     @options[:relayed_through_account] && Relay.find_by(inbox_url: @options[:relayed_through_account].inbox_url)&.enabled?
   end
+
+  def reject_payload!
+    Rails.logger.info("Rejected #{@json['type']} activity #{@json['id']} from #{@account.uri}#{@options[:relayed_through_account] && "via #{@options[:relayed_through_account].uri}"}")
+    nil
+  end
 end