Merge tag 'v2.6.0rc1' into instance_only_statuses
This commit is contained in:
		| @ -11,7 +11,7 @@ class REST::AccountSerializer < ActiveModel::Serializer | ||||
|   has_many :emojis, serializer: REST::CustomEmojiSerializer | ||||
|  | ||||
|   class FieldSerializer < ActiveModel::Serializer | ||||
|     attributes :name, :value | ||||
|     attributes :name, :value, :verified_at | ||||
|  | ||||
|     def value | ||||
|       Formatter.instance.format_field(object.account, object.value) | ||||
|  | ||||
							
								
								
									
										12
									
								
								app/serializers/rest/conversation_serializer.rb
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								app/serializers/rest/conversation_serializer.rb
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,12 @@ | ||||
| # frozen_string_literal: true | ||||
|  | ||||
| class REST::ConversationSerializer < ActiveModel::Serializer | ||||
|   attributes :id, :unread | ||||
|  | ||||
|   has_many :participant_accounts, key: :accounts, serializer: REST::AccountSerializer | ||||
|   has_one :last_status, serializer: REST::StatusSerializer | ||||
|  | ||||
|   def id | ||||
|     object.id.to_s | ||||
|   end | ||||
| end | ||||
| @ -36,6 +36,17 @@ class REST::StatusSerializer < ActiveModel::Serializer | ||||
|     !current_user.nil? | ||||
|   end | ||||
|  | ||||
|   def visibility | ||||
|     # This visibility is masked behind "private" | ||||
|     # to avoid API changes because there are no | ||||
|     # UX differences | ||||
|     if object.limited_visibility? | ||||
|       'private' | ||||
|     else | ||||
|       object.visibility | ||||
|     end | ||||
|   end | ||||
|  | ||||
|   def uri | ||||
|     OStatus::TagManager.instance.uri_for(object) | ||||
|   end | ||||
| @ -88,7 +99,7 @@ class REST::StatusSerializer < ActiveModel::Serializer | ||||
|   end | ||||
|  | ||||
|   def ordered_mentions | ||||
|     object.mentions.to_a.sort_by(&:id) | ||||
|     object.active_mentions.to_a.sort_by(&:id) | ||||
|   end | ||||
|  | ||||
|   class ApplicationSerializer < ActiveModel::Serializer | ||||
|  | ||||
		Reference in New Issue
	
	Block a user