Merge remote-tracking branch 'parent/main' into upstream-20240926
This commit is contained in:
commit
c905714459
517 changed files with 4284 additions and 3891 deletions
|
@ -23,7 +23,9 @@ class ActivityPub::NoteSerializer < ActivityPub::Serializer
|
|||
has_many :virtual_tags, key: :tag
|
||||
|
||||
has_one :replies, serializer: ActivityPub::CollectionSerializer, if: :local?
|
||||
has_one :references, serializer: ActivityPub::CollectionSerializer
|
||||
has_one :references, 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?
|
||||
|
@ -89,6 +91,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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue