mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-12-16 01:09:55 +00:00
Merge commit '591df1f205c654381203b56d46498efc62370776' into glitch-soc/merge-upstream
This commit is contained in:
@@ -230,7 +230,7 @@ class ActivityPub::Activity::Create < ActivityPub::Activity
|
||||
return if @quote_uri.blank?
|
||||
|
||||
approval_uri = @status_parser.quote_approval_uri
|
||||
approval_uri = nil if unsupported_uri_scheme?(approval_uri)
|
||||
approval_uri = nil if unsupported_uri_scheme?(approval_uri) || TagManager.instance.local_url?(approval_uri)
|
||||
@quote = Quote.new(account: @account, approval_uri: approval_uri, legacy: @status_parser.legacy_quote?)
|
||||
end
|
||||
|
||||
|
||||
@@ -154,9 +154,6 @@ class ActivityPub::Parser::StatusParser
|
||||
# Remove the special-meaning actor URI
|
||||
allowed_actors.delete(@options[:actor_uri])
|
||||
|
||||
# Tagged users are always allowed, so remove them
|
||||
allowed_actors -= as_array(@object['tag']).filter_map { |tag| tag['href'] if equals_or_includes?(tag['type'], 'Mention') }
|
||||
|
||||
# Any unrecognized actor is marked as unknown
|
||||
flags |= Status::QUOTE_APPROVAL_POLICY_FLAGS[:unknown] unless allowed_actors.empty?
|
||||
|
||||
|
||||
@@ -51,6 +51,13 @@ class ActivityPub::TagManager
|
||||
end
|
||||
end
|
||||
|
||||
def approval_uri_for(quote, check_approval: true)
|
||||
return quote.approval_uri unless quote.quoted_account&.local?
|
||||
return if check_approval && !quote.accepted?
|
||||
|
||||
account_quote_authorization_url(quote.quoted_account, quote)
|
||||
end
|
||||
|
||||
def key_uri_for(target)
|
||||
[uri_for(target), '#main-key'].join
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user