parent
913a38111f
commit
e6520c0270
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
class ActivityPub::Activity::Remove < ActivityPub::Activity
|
class ActivityPub::Activity::Remove < ActivityPub::Activity
|
||||||
def perform
|
def perform
|
||||||
return unless @json['origin'].present? && value_or_id(@json['origin']) == @account.featured_collection_url
|
return unless @json['target'].present? && value_or_id(@json['target']) == @account.featured_collection_url
|
||||||
|
|
||||||
status = status_from_uri(object_uri)
|
status = status_from_uri(object_uri)
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
class ActivityPub::RemoveSerializer < ActiveModel::Serializer
|
class ActivityPub::RemoveSerializer < ActiveModel::Serializer
|
||||||
include RoutingHelper
|
include RoutingHelper
|
||||||
|
|
||||||
attributes :type, :actor, :origin
|
attributes :type, :actor, :target
|
||||||
attribute :proper_object, key: :object
|
attribute :proper_object, key: :object
|
||||||
|
|
||||||
def type
|
def type
|
||||||
|
@ -18,7 +18,7 @@ class ActivityPub::RemoveSerializer < ActiveModel::Serializer
|
||||||
ActivityPub::TagManager.instance.uri_for(object)
|
ActivityPub::TagManager.instance.uri_for(object)
|
||||||
end
|
end
|
||||||
|
|
||||||
def origin
|
def target
|
||||||
account_collection_url(object, :featured)
|
account_collection_url(object, :featured)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -11,7 +11,7 @@ RSpec.describe ActivityPub::Activity::Remove do
|
||||||
type: 'Add',
|
type: 'Add',
|
||||||
actor: ActivityPub::TagManager.instance.uri_for(sender),
|
actor: ActivityPub::TagManager.instance.uri_for(sender),
|
||||||
object: ActivityPub::TagManager.instance.uri_for(status),
|
object: ActivityPub::TagManager.instance.uri_for(status),
|
||||||
origin: sender.featured_collection_url,
|
target: sender.featured_collection_url,
|
||||||
}.with_indifferent_access
|
}.with_indifferent_access
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue