mirror of
https://github.com/lunaisnotaboy/mastodon.git
synced 2024-11-17 04:13:01 +00:00
Advertise supported MIME types for statuses (#2090)
This commit is contained in:
parent
26c2b401a5
commit
c4a5e0ca0e
|
@ -1,6 +1,8 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class HtmlAwareFormatter
|
class HtmlAwareFormatter
|
||||||
|
STATUS_MIME_TYPES = %w(text/plain text/markdown text/html).freeze
|
||||||
|
|
||||||
attr_reader :text, :local, :options
|
attr_reader :text, :local, :options
|
||||||
|
|
||||||
alias local? local
|
alias local? local
|
||||||
|
|
|
@ -55,6 +55,7 @@ class REST::InstanceSerializer < ActiveModel::Serializer
|
||||||
max_characters: StatusLengthValidator::MAX_CHARS,
|
max_characters: StatusLengthValidator::MAX_CHARS,
|
||||||
max_media_attachments: 4,
|
max_media_attachments: 4,
|
||||||
characters_reserved_per_url: StatusLengthValidator::URL_PLACEHOLDER_CHARS,
|
characters_reserved_per_url: StatusLengthValidator::URL_PLACEHOLDER_CHARS,
|
||||||
|
supported_mime_types: HtmlAwareFormatter::STATUS_MIME_TYPES,
|
||||||
},
|
},
|
||||||
|
|
||||||
media_attachments: {
|
media_attachments: {
|
||||||
|
|
|
@ -79,6 +79,7 @@ class REST::V1::InstanceSerializer < ActiveModel::Serializer
|
||||||
max_characters: StatusLengthValidator::MAX_CHARS,
|
max_characters: StatusLengthValidator::MAX_CHARS,
|
||||||
max_media_attachments: 4,
|
max_media_attachments: 4,
|
||||||
characters_reserved_per_url: StatusLengthValidator::URL_PLACEHOLDER_CHARS,
|
characters_reserved_per_url: StatusLengthValidator::URL_PLACEHOLDER_CHARS,
|
||||||
|
supported_mime_types: HtmlAwareFormatter::STATUS_MIME_TYPES,
|
||||||
},
|
},
|
||||||
|
|
||||||
media_attachments: {
|
media_attachments: {
|
||||||
|
|
Loading…
Reference in a new issue