Merge tag 'v4.4.6'
This commit is contained in:
commit
bfb5667768
102 changed files with 1514 additions and 474 deletions
|
|
@ -217,11 +217,11 @@ class ActivityPub::Activity::Create < ActivityPub::Activity
|
|||
|
||||
def process_quote
|
||||
@quote_uri = @status_parser.quote_uri
|
||||
return if @quote_uri.blank?
|
||||
return unless @status_parser.quote?
|
||||
|
||||
approval_uri = @status_parser.quote_approval_uri
|
||||
approval_uri = nil if unsupported_uri_scheme?(approval_uri)
|
||||
@quote = Quote.new(account: @account, approval_uri: approval_uri, legacy: @status_parser.legacy_quote?)
|
||||
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?, state: @status_parser.deleted_quote? ? :deleted : :pending)
|
||||
end
|
||||
|
||||
def process_hashtag(tag)
|
||||
|
|
|
|||
|
|
@ -117,6 +117,14 @@ class ActivityPub::Parser::StatusParser
|
|||
flags
|
||||
end
|
||||
|
||||
def quote?
|
||||
%w(quote _misskey_quote quoteUrl quoteUri).any? { |key| @object[key].present? }
|
||||
end
|
||||
|
||||
def deleted_quote?
|
||||
@object['quote'].is_a?(Hash) && @object['quote']['type'] == 'Tombstone'
|
||||
end
|
||||
|
||||
def quote_uri
|
||||
%w(quote _misskey_quote quoteUrl quoteUri).filter_map do |key|
|
||||
value_or_id(as_array(@object[key]).first)
|
||||
|
|
@ -141,7 +149,7 @@ class ActivityPub::Parser::StatusParser
|
|||
def quote_subpolicy(subpolicy)
|
||||
flags = 0
|
||||
|
||||
allowed_actors = as_array(subpolicy)
|
||||
allowed_actors = as_array(subpolicy).dup
|
||||
allowed_actors.uniq!
|
||||
|
||||
flags |= Status::QUOTE_APPROVAL_POLICY_FLAGS[:public] if allowed_actors.delete('as:Public') || allowed_actors.delete('Public') || allowed_actors.delete('https://www.w3.org/ns/activitystreams#Public')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue