Merge commit 'c44cc1f5c3bafb49a324f8f72a42a91d09eecfe3' into glitch-soc/merge-upstream
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class ActivityPub::FeaturedItemSerializer < ActivityPub::Serializer
|
||||
attributes :type, :featured_object, :featured_object_type
|
||||
attributes :id, :type, :featured_object, :featured_object_type
|
||||
|
||||
def id
|
||||
ActivityPub::TagManager.instance.uri_for(object)
|
||||
end
|
||||
|
||||
def type
|
||||
'FeaturedItem'
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class ActivityPub::RemoveFeaturedItemSerializer < ActivityPub::Serializer
|
||||
include RoutingHelper
|
||||
|
||||
attributes :type, :actor, :target
|
||||
has_one :virtual_object, key: :object
|
||||
|
||||
def type
|
||||
'Remove'
|
||||
end
|
||||
|
||||
def actor
|
||||
ActivityPub::TagManager.instance.uri_for(collection.account)
|
||||
end
|
||||
|
||||
def target
|
||||
ActivityPub::TagManager.instance.uri_for(collection)
|
||||
end
|
||||
|
||||
def virtual_object
|
||||
ActivityPub::TagManager.instance.uri_for(object)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def collection
|
||||
@collection ||= object.collection
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user