mirror of
https://github.com/yingziwu/mastodon.git
synced 2026-02-04 03:25:14 +00:00
Add API endpoints to view and revoke one's quoted posts (#35578)
This commit is contained in:
parent
572a0e128d
commit
2dfdcc7dcb
10 changed files with 324 additions and 0 deletions
|
|
@ -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
|
||||
Loading…
Add table
Add a link
Reference in a new issue