Support Actors/Statuses with multiple types (#7305)
* Add equals_or_includes_any? helper in JsonLdHelper * Support arrays in JSON-LD type fields for actors/tags/objects. * Spec for resolving accounts with extension types * Style tweaks for codeclimate
This commit is contained in:
		
				
					committed by
					
						
						Eugen Rochko
					
				
			
			
				
	
			
			
			
						parent
						
							86efccce2a
						
					
				
				
					commit
					dc786c0cf4
				
			@@ -61,12 +61,11 @@ class ActivityPub::Activity::Create < ActivityPub::Activity
 | 
			
		||||
    return if @object['tag'].nil?
 | 
			
		||||
 | 
			
		||||
    as_array(@object['tag']).each do |tag|
 | 
			
		||||
      case tag['type']
 | 
			
		||||
      when 'Hashtag'
 | 
			
		||||
      if equals_or_includes?(tag['type'], 'Hashtag')
 | 
			
		||||
        process_hashtag tag, status
 | 
			
		||||
      when 'Mention'
 | 
			
		||||
      elsif equals_or_includes?(tag['type'], 'Mention')
 | 
			
		||||
        process_mention tag, status
 | 
			
		||||
      when 'Emoji'
 | 
			
		||||
      elsif equals_or_includes?(tag['type'], 'Emoji')
 | 
			
		||||
        process_emoji tag, status
 | 
			
		||||
      end
 | 
			
		||||
    end
 | 
			
		||||
@@ -235,11 +234,11 @@ class ActivityPub::Activity::Create < ActivityPub::Activity
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def supported_object_type?
 | 
			
		||||
    SUPPORTED_TYPES.include?(@object['type'])
 | 
			
		||||
    equals_or_includes_any?(@object['type'], SUPPORTED_TYPES)
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def converted_object_type?
 | 
			
		||||
    CONVERTED_TYPES.include?(@object['type'])
 | 
			
		||||
    equals_or_includes_any?(@object['type'], CONVERTED_TYPES)
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def skip_download?
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user