Add Status::MEDIA_ATTACHMENTS_LIMIT
configuration constant (#30433)
This commit is contained in:
parent
87156f57b5
commit
c61e356475
9 changed files with 15 additions and 12 deletions
|
@ -110,7 +110,7 @@ class ActivityPub::Activity::Create < ActivityPub::Activity
|
|||
def process_status_params
|
||||
@status_parser = ActivityPub::Parser::StatusParser.new(@json, followers_collection: @account.followers_url, object: @object)
|
||||
|
||||
attachment_ids = process_attachments.take(4).map(&:id)
|
||||
attachment_ids = process_attachments.take(Status::MEDIA_ATTACHMENTS_LIMIT).map(&:id)
|
||||
|
||||
@params = {
|
||||
uri: @status_parser.uri,
|
||||
|
@ -260,7 +260,7 @@ class ActivityPub::Activity::Create < ActivityPub::Activity
|
|||
as_array(@object['attachment']).each do |attachment|
|
||||
media_attachment_parser = ActivityPub::Parser::MediaAttachmentParser.new(attachment)
|
||||
|
||||
next if media_attachment_parser.remote_url.blank? || media_attachments.size >= 4
|
||||
next if media_attachment_parser.remote_url.blank? || media_attachments.size >= Status::MEDIA_ATTACHMENTS_LIMIT
|
||||
|
||||
begin
|
||||
media_attachment = MediaAttachment.create(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue