From b6709d7ec9a3f33af5d8ea8fe001ddb7248d2f89 Mon Sep 17 00:00:00 2001 From: Emelia Smith Date: Sat, 17 Feb 2024 21:19:25 +0100 Subject: [PATCH] Enable rejection of Create Activities if the status includes unusable hashtags --- app/lib/activitypub/activity/create.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/lib/activitypub/activity/create.rb b/app/lib/activitypub/activity/create.rb index 85195f4c395..d6516a98f62 100644 --- a/app/lib/activitypub/activity/create.rb +++ b/app/lib/activitypub/activity/create.rb @@ -82,6 +82,9 @@ class ActivityPub::Activity::Create < ActivityPub::Activity process_tags process_audience + # Reject the status unless all the hashtags are usable: + return reject_payload! unless @tags.all?(&:usable?) + ApplicationRecord.transaction do @status = Status.create!(@params) attach_tags(@status)