mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-12-15 16:59:41 +00:00
Merge commit '5dfdec645313e556413147597138a8008bc35996' into glitch-soc/merge-upstream
This commit is contained in:
@@ -21,6 +21,8 @@ class ActivityPub::NoteSerializer < ActivityPub::Serializer
|
||||
has_many :virtual_tags, key: :tag
|
||||
|
||||
has_one :replies, serializer: ActivityPub::CollectionSerializer, if: :local?
|
||||
has_one :likes, serializer: ActivityPub::CollectionSerializer, if: :local?
|
||||
has_one :shares, serializer: ActivityPub::CollectionSerializer, if: :local?
|
||||
|
||||
has_many :poll_options, key: :one_of, if: :poll_and_not_multiple?
|
||||
has_many :poll_options, key: :any_of, if: :poll_and_multiple?
|
||||
@@ -76,6 +78,22 @@ class ActivityPub::NoteSerializer < ActivityPub::Serializer
|
||||
)
|
||||
end
|
||||
|
||||
def likes
|
||||
ActivityPub::CollectionPresenter.new(
|
||||
id: ActivityPub::TagManager.instance.likes_uri_for(object),
|
||||
type: :unordered,
|
||||
size: object.favourites_count
|
||||
)
|
||||
end
|
||||
|
||||
def shares
|
||||
ActivityPub::CollectionPresenter.new(
|
||||
id: ActivityPub::TagManager.instance.shares_uri_for(object),
|
||||
type: :unordered,
|
||||
size: object.reblogs_count
|
||||
)
|
||||
end
|
||||
|
||||
def language?
|
||||
object.language.present?
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user