Add published property to ActivityPub activity for reblogs (#5000)
Since reblogs are serialized as Announce activity, its published property can be used for the creation time of reblog.
This commit is contained in:
parent
dcf1139ebd
commit
17bf3363ac
2 changed files with 11 additions and 2 deletions
|
@ -1,7 +1,7 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class ActivityPub::ActivitySerializer < ActiveModel::Serializer
|
||||
attributes :id, :type, :actor, :to, :cc
|
||||
attributes :id, :type, :actor, :published, :to, :cc
|
||||
|
||||
has_one :proper, key: :object, serializer: ActivityPub::NoteSerializer
|
||||
|
||||
|
@ -17,6 +17,10 @@ class ActivityPub::ActivitySerializer < ActiveModel::Serializer
|
|||
ActivityPub::TagManager.instance.uri_for(object.account)
|
||||
end
|
||||
|
||||
def published
|
||||
object.created_at.iso8601
|
||||
end
|
||||
|
||||
def to
|
||||
ActivityPub::TagManager.instance.to(object)
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue