From e9f439a625d8edc589cb229ee15ef54bd1067576 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=88=E6=A7=8D=E7=94=B1=E7=B4=80?= Date: Sat, 17 Feb 2024 16:15:39 -0500 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 c133ef673a..489863fedb 100644 --- a/app/lib/activitypub/activity/create.rb +++ b/app/lib/activitypub/activity/create.rb @@ -86,6 +86,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)