mirror of
https://github.com/mastodon/mastodon.git
synced 2024-12-25 12:34:58 +01:00
Fix process of receiving posts with bearcaps is not working (#26527)
This commit is contained in:
parent
38f7f8b909
commit
9a8293f58d
@ -108,7 +108,7 @@ class ActivityPub::Activity::Create < ActivityPub::Activity
|
|||||||
end
|
end
|
||||||
|
|
||||||
def process_status_params
|
def process_status_params
|
||||||
@status_parser = ActivityPub::Parser::StatusParser.new(@json, followers_collection: @account.followers_url)
|
@status_parser = ActivityPub::Parser::StatusParser.new(@json, followers_collection: @account.followers_url, object: @object)
|
||||||
|
|
||||||
attachment_ids = process_attachments.take(4).map(&:id)
|
attachment_ids = process_attachments.take(4).map(&:id)
|
||||||
|
|
||||||
|
@ -4,12 +4,13 @@ class ActivityPub::Parser::StatusParser
|
|||||||
include JsonLdHelper
|
include JsonLdHelper
|
||||||
|
|
||||||
# @param [Hash] json
|
# @param [Hash] json
|
||||||
# @param [Hash] magic_values
|
# @param [Hash] options
|
||||||
# @option magic_values [String] :followers_collection
|
# @option options [String] :followers_collection
|
||||||
def initialize(json, magic_values = {})
|
# @option options [Hash] :object
|
||||||
|
def initialize(json, **options)
|
||||||
@json = json
|
@json = json
|
||||||
@object = json['object'] || json
|
@object = options[:object] || json['object'] || json
|
||||||
@magic_values = magic_values
|
@options = options
|
||||||
end
|
end
|
||||||
|
|
||||||
def uri
|
def uri
|
||||||
@ -78,7 +79,7 @@ class ActivityPub::Parser::StatusParser
|
|||||||
:public
|
:public
|
||||||
elsif audience_cc.any? { |cc| ActivityPub::TagManager.instance.public_collection?(cc) }
|
elsif audience_cc.any? { |cc| ActivityPub::TagManager.instance.public_collection?(cc) }
|
||||||
:unlisted
|
:unlisted
|
||||||
elsif audience_to.include?(@magic_values[:followers_collection])
|
elsif audience_to.include?(@options[:followers_collection])
|
||||||
:private
|
:private
|
||||||
else
|
else
|
||||||
:direct
|
:direct
|
||||||
|
Loading…
Reference in New Issue
Block a user