Enable rejection of Create Activities if the status includes unusable hashtags

This commit is contained in:
Emelia Smith 2024-02-17 21:19:25 +01:00 committed by Essem
parent c866e48f69
commit de18f3069c
No known key found for this signature in database
GPG key ID: 7D497397CC3A2A8C

View file

@ -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)