mirror of
https://github.com/glitch-soc/mastodon.git
synced 2026-03-29 03:00:33 +02:00
Convert remaining JSON.generate (#38240)
This commit is contained in:
@@ -440,7 +440,7 @@ class ActivityPub::Activity::Create < ActivityPub::Activity
|
||||
def forward_for_reply
|
||||
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
|
||||
|
||||
def increment_voters_count!
|
||||
|
||||
@@ -40,7 +40,7 @@ class ActivityPub::Activity::FeatureRequest < ActivityPub::Activity
|
||||
end
|
||||
|
||||
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)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -20,7 +20,7 @@ class ActivityPub::Forwarder
|
||||
private
|
||||
|
||||
def payload
|
||||
@payload ||= Oj.dump(@json)
|
||||
@payload ||= JSON.generate(@json)
|
||||
end
|
||||
|
||||
def reblogged_by_account_ids
|
||||
|
||||
@@ -10,7 +10,7 @@ class Webhooks::PayloadRenderer
|
||||
|
||||
def get(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
|
||||
# other strings, so it can't be wrapped in quotes.
|
||||
|
||||
@@ -61,7 +61,7 @@ class Scheduler::SelfDestructScheduler
|
||||
adapter: ActivityPub::Adapter
|
||||
).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|
|
||||
[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
|
||||
|
||||
File.write(dest, Oj.dump(map))
|
||||
File.write(dest, JSON.dump(map))
|
||||
puts "Wrote emojo to destination! (#{dest})"
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user