2019-03-10 23:49:31 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2019-03-27 14:55:23 +00:00
|
|
|
class ActivityPub::UpdatePollSerializer < ActivityPub::Serializer
|
2019-03-10 23:49:31 +00:00
|
|
|
attributes :id, :type, :actor, :to
|
|
|
|
|
|
|
|
has_one :object, serializer: ActivityPub::NoteSerializer
|
|
|
|
|
|
|
|
def id
|
2019-03-28 03:44:59 +00:00
|
|
|
[ActivityPub::TagManager.instance.uri_for(object), '#updates/', object.preloadable_poll.updated_at.to_i].join
|
2019-03-10 23:49:31 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def type
|
|
|
|
'Update'
|
|
|
|
end
|
|
|
|
|
|
|
|
def actor
|
2019-06-27 17:41:55 +00:00
|
|
|
ActivityPub::TagManager.instance.uri_for(object.account)
|
2019-03-10 23:49:31 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def to
|
|
|
|
ActivityPub::TagManager.instance.to(object)
|
|
|
|
end
|
|
|
|
|
|
|
|
def cc
|
|
|
|
ActivityPub::TagManager.instance.cc(object)
|
|
|
|
end
|
|
|
|
end
|