Convert remaining JSON.generate (#38240)
This commit is contained in:
@@ -440,7 +440,7 @@ class ActivityPub::Activity::Create < ActivityPub::Activity
|
|||||||
def forward_for_reply
|
def forward_for_reply
|
||||||
return unless @status.distributable? && @json['signature'].present? && reply_to_local?
|
return unless @status.distributable? && @json['signature'].present? && reply_to_local?
|
||||||
|
|
||||||
ActivityPub::RawDistributionWorker.perform_async(Oj.dump(@json), replied_to_status.account_id, [@account.preferred_inbox_url])
|
ActivityPub::RawDistributionWorker.perform_async(JSON.generate(@json), replied_to_status.account_id, [@account.preferred_inbox_url])
|
||||||
end
|
end
|
||||||
|
|
||||||
def increment_voters_count!
|
def increment_voters_count!
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ class ActivityPub::Activity::FeatureRequest < ActivityPub::Activity
|
|||||||
end
|
end
|
||||||
|
|
||||||
def queue_delivery!(collection_item, serializer)
|
def queue_delivery!(collection_item, serializer)
|
||||||
json = Oj.dump(serialize_payload(collection_item, serializer))
|
json = JSON.generate(serialize_payload(collection_item, serializer))
|
||||||
ActivityPub::DeliveryWorker.perform_async(json, @featured_account.id, @account.inbox_url)
|
ActivityPub::DeliveryWorker.perform_async(json, @featured_account.id, @account.inbox_url)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ class ActivityPub::Forwarder
|
|||||||
private
|
private
|
||||||
|
|
||||||
def payload
|
def payload
|
||||||
@payload ||= Oj.dump(@json)
|
@payload ||= JSON.generate(@json)
|
||||||
end
|
end
|
||||||
|
|
||||||
def reblogged_by_account_ids
|
def reblogged_by_account_ids
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ class Webhooks::PayloadRenderer
|
|||||||
|
|
||||||
def get(path)
|
def get(path)
|
||||||
value = @document.dig(*parse_path(path))
|
value = @document.dig(*parse_path(path))
|
||||||
string = Oj.dump(value)
|
string = JSON.generate(value)
|
||||||
|
|
||||||
# We want to make sure people can use the variable inside
|
# We want to make sure people can use the variable inside
|
||||||
# other strings, so it can't be wrapped in quotes.
|
# other strings, so it can't be wrapped in quotes.
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ class Scheduler::SelfDestructScheduler
|
|||||||
adapter: ActivityPub::Adapter
|
adapter: ActivityPub::Adapter
|
||||||
).as_json
|
).as_json
|
||||||
|
|
||||||
json = Oj.dump(ActivityPub::LinkedDataSignature.new(payload).sign!(account))
|
json = JSON.generate(ActivityPub::LinkedDataSignature.new(payload).sign!(account))
|
||||||
|
|
||||||
ActivityPub::DeliveryWorker.push_bulk(inboxes, limit: 1_000) do |inbox_url|
|
ActivityPub::DeliveryWorker.push_bulk(inboxes, limit: 1_000) do |inbox_url|
|
||||||
[json, account.id, inbox_url]
|
[json, account.id, inbox_url]
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ namespace :emojis do
|
|||||||
|
|
||||||
map = map.sort { |a, b| a[0].size <=> b[0].size }.to_h
|
map = map.sort { |a, b| a[0].size <=> b[0].size }.to_h
|
||||||
|
|
||||||
File.write(dest, Oj.dump(map))
|
File.write(dest, JSON.dump(map))
|
||||||
puts "Wrote emojo to destination! (#{dest})"
|
puts "Wrote emojo to destination! (#{dest})"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user