Add Status::MEDIA_ATTACHMENTS_LIMIT configuration constant (#30433)

This commit is contained in:
Matt Jankowski 2024-05-27 05:49:44 -04:00 committed by GitHub
parent 87156f57b5
commit c61e356475
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 15 additions and 12 deletions

View file

@ -73,7 +73,7 @@ class ActivityPub::ProcessStatusUpdateService < BaseService
as_array(@json['attachment']).each do |attachment|
media_attachment_parser = ActivityPub::Parser::MediaAttachmentParser.new(attachment)
next if media_attachment_parser.remote_url.blank? || @next_media_attachments.size > 4
next if media_attachment_parser.remote_url.blank? || @next_media_attachments.size > Status::MEDIA_ATTACHMENTS_LIMIT
begin
media_attachment = previous_media_attachments.find { |previous_media_attachment| previous_media_attachment.remote_url == media_attachment_parser.remote_url }