Add API endpoints to view and revoke one's quoted posts (#35578)

This commit is contained in:
Claire 2025-07-31 11:36:51 +02:00 committed by GitHub
parent 572a0e128d
commit 2dfdcc7dcb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 324 additions and 0 deletions

View file

@ -0,0 +1,28 @@
# frozen_string_literal: true
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
def id
[object.approval_uri, '#delete'].join
end
def virtual_object
object.approval_uri
end
def type
'Delete'
end
def actor
ActivityPub::TagManager.instance.uri_for(object.quoted_account)
end
def to
[ActivityPub::TagManager::COLLECTIONS[:public]]
end
end