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