mirror of
https://github.com/mastodon/mastodon.git
synced 2025-10-07 01:22:44 +00:00
Change serialization of Delete
activities for QuoteAuthorization
to inline the latter (#35725)
This commit is contained in:
parent
dbab3912bd
commit
0e99d428b2
|
@ -3,15 +3,14 @@
|
||||||
class ActivityPub::DeleteQuoteAuthorizationSerializer < ActivityPub::Serializer
|
class ActivityPub::DeleteQuoteAuthorizationSerializer < ActivityPub::Serializer
|
||||||
attributes :id, :type, :actor, :to
|
attributes :id, :type, :actor, :to
|
||||||
|
|
||||||
# TODO: change the `object` to a `QuoteAuthorization` object instead of just the URI?
|
has_one :virtual_object, key: :object, serializer: ActivityPub::QuoteAuthorizationSerializer
|
||||||
attribute :virtual_object, key: :object
|
|
||||||
|
|
||||||
def id
|
def id
|
||||||
[ActivityPub::TagManager.instance.approval_uri_for(object, check_approval: false), '#delete'].join
|
[ActivityPub::TagManager.instance.approval_uri_for(object, check_approval: false), '#delete'].join
|
||||||
end
|
end
|
||||||
|
|
||||||
def virtual_object
|
def virtual_object
|
||||||
ActivityPub::TagManager.instance.approval_uri_for(object, check_approval: false)
|
object
|
||||||
end
|
end
|
||||||
|
|
||||||
def type
|
def type
|
||||||
|
|
|
@ -13,7 +13,10 @@ RSpec.describe ActivityPub::DeleteQuoteAuthorizationSerializer do
|
||||||
expect(subject.deep_symbolize_keys)
|
expect(subject.deep_symbolize_keys)
|
||||||
.to include(
|
.to include(
|
||||||
actor: eq(ActivityPub::TagManager.instance.uri_for(status.account)),
|
actor: eq(ActivityPub::TagManager.instance.uri_for(status.account)),
|
||||||
object: ActivityPub::TagManager.instance.approval_uri_for(quote, check_approval: false),
|
object: a_hash_including(
|
||||||
|
type: 'QuoteAuthorization',
|
||||||
|
id: ActivityPub::TagManager.instance.approval_uri_for(quote, check_approval: false)
|
||||||
|
),
|
||||||
type: 'Delete'
|
type: 'Delete'
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue
Block a user