From 6f7e917f3210c1925d86c09e22fcafb9013134d0 Mon Sep 17 00:00:00 2001 From: Jeremy Kescher Date: Fri, 4 Oct 2024 14:25:37 +0200 Subject: [PATCH] Fix inability to create ActivityPub messages --- app/lib/activitypub/activity/create.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/lib/activitypub/activity/create.rb b/app/lib/activitypub/activity/create.rb index fe33f7e408..e8fd2de15e 100644 --- a/app/lib/activitypub/activity/create.rb +++ b/app/lib/activitypub/activity/create.rb @@ -15,6 +15,10 @@ class ActivityPub::Activity::Create < ActivityPub::Activity private + def reject_pattern? + Setting.reject_pattern.present? && @object['content']&.match?(Setting.reject_pattern) + end + def create_status return reject_payload! if unsupported_object_type? || non_matching_uri_hosts?(@account.uri, object_uri) || tombstone_exists? || !related_to_local_activity? || reject_pattern?