Merge branch 'main' into glitch-soc/merge-upstream
Conflicts: - `README.md`: our READMEs are entirely different and upstream's has been updated. Kept our README.
This commit is contained in:
@ -181,6 +181,8 @@ class ActivityPub::NoteSerializer < ActivityPub::Serializer
|
||||
|
||||
attributes :type, :media_type, :url, :name, :blurhash
|
||||
attribute :focal_point, if: :focal_point?
|
||||
attribute :width, if: :width?
|
||||
attribute :height, if: :height?
|
||||
|
||||
has_one :icon, serializer: ActivityPub::ImageSerializer, if: :thumbnail?
|
||||
|
||||
@ -215,6 +217,22 @@ class ActivityPub::NoteSerializer < ActivityPub::Serializer
|
||||
def thumbnail?
|
||||
object.thumbnail.present?
|
||||
end
|
||||
|
||||
def width?
|
||||
object.file.meta&.dig('original', 'width').present?
|
||||
end
|
||||
|
||||
def height?
|
||||
object.file.meta&.dig('original', 'height').present?
|
||||
end
|
||||
|
||||
def width
|
||||
object.file.meta.dig('original', 'width')
|
||||
end
|
||||
|
||||
def height
|
||||
object.file.meta.dig('original', 'height')
|
||||
end
|
||||
end
|
||||
|
||||
class MentionSerializer < ActivityPub::Serializer
|
||||
|
Reference in New Issue
Block a user