mirror of
https://github.com/yingziwu/mastodon.git
synced 2026-02-04 03:25:14 +00:00
Accept remote quotes of local quotes according to set policy (#35629)
This commit is contained in:
parent
0153a239db
commit
32791c9745
5 changed files with 110 additions and 3 deletions
|
|
@ -0,0 +1,23 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class ActivityPub::AcceptQuoteRequestSerializer < ActivityPub::Serializer
|
||||
attributes :id, :type, :actor, :result
|
||||
|
||||
has_one :object, serializer: ActivityPub::QuoteRequestSerializer
|
||||
|
||||
def id
|
||||
[ActivityPub::TagManager.instance.uri_for(object.quoted_account), '#accepts/quote_requests/', object.id].join
|
||||
end
|
||||
|
||||
def type
|
||||
'Accept'
|
||||
end
|
||||
|
||||
def actor
|
||||
ActivityPub::TagManager.instance.uri_for(object.quoted_account)
|
||||
end
|
||||
|
||||
def result
|
||||
ActivityPub::TagManager.instance.approval_uri_for(object)
|
||||
end
|
||||
end
|
||||
|
|
@ -23,6 +23,7 @@ class ActivityPub::QuoteRequestSerializer < ActivityPub::Serializer
|
|||
end
|
||||
|
||||
def instrument
|
||||
# TODO: inline object?
|
||||
ActivityPub::TagManager.instance.uri_for(object.status)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue