Allow ActivityPub Note's tag and attachment to be single objects (#5534)
This commit is contained in:
parent
0129f5eada
commit
0cb329f63a
2 changed files with 8 additions and 4 deletions
|
@ -53,9 +53,9 @@ class ActivityPub::Activity::Create < ActivityPub::Activity
|
|||
end
|
||||
|
||||
def process_tags(status)
|
||||
return unless @object['tag'].is_a?(Array)
|
||||
return if @object['tag'].nil?
|
||||
|
||||
@object['tag'].each do |tag|
|
||||
as_array(@object['tag']).each do |tag|
|
||||
case tag['type']
|
||||
when 'Hashtag'
|
||||
process_hashtag tag, status
|
||||
|
@ -103,9 +103,9 @@ class ActivityPub::Activity::Create < ActivityPub::Activity
|
|||
end
|
||||
|
||||
def process_attachments(status)
|
||||
return unless @object['attachment'].is_a?(Array)
|
||||
return if @object['attachment'].nil?
|
||||
|
||||
@object['attachment'].each do |attachment|
|
||||
as_array(@object['attachment']).each do |attachment|
|
||||
next if unsupported_media_type?(attachment['mediaType']) || attachment['url'].blank?
|
||||
|
||||
href = Addressable::URI.parse(attachment['url']).normalize.to_s
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue