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