Merge commit '5dfdec645313e556413147597138a8008bc35996' into glitch-soc/merge-upstream

This commit is contained in:
Claire
2024-09-23 20:24:18 +02:00
124 changed files with 902 additions and 699 deletions

View File

@@ -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