mirror of
https://github.com/mastodon/mastodon.git
synced 2025-10-05 08:33:00 +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
|
||||
attributes :id, :type, :actor, :to
|
||||
|
||||
# TODO: change the `object` to a `QuoteAuthorization` object instead of just the URI?
|
||||
attribute :virtual_object, key: :object
|
||||
has_one :virtual_object, key: :object, serializer: ActivityPub::QuoteAuthorizationSerializer
|
||||
|
||||
def id
|
||||
[ActivityPub::TagManager.instance.approval_uri_for(object, check_approval: false), '#delete'].join
|
||||
end
|
||||
|
||||
def virtual_object
|
||||
ActivityPub::TagManager.instance.approval_uri_for(object, check_approval: false)
|
||||
object
|
||||
end
|
||||
|
||||
def type
|
||||
|
|
|
@ -13,7 +13,10 @@ RSpec.describe ActivityPub::DeleteQuoteAuthorizationSerializer do
|
|||
expect(subject.deep_symbolize_keys)
|
||||
.to include(
|
||||
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'
|
||||
)
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue
Block a user