diff --git a/app/lib/activitypub/activity/create.rb b/app/lib/activitypub/activity/create.rb index 24ea62510b..cd4e1a3421 100644 --- a/app/lib/activitypub/activity/create.rb +++ b/app/lib/activitypub/activity/create.rb @@ -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! diff --git a/app/lib/activitypub/activity/feature_request.rb b/app/lib/activitypub/activity/feature_request.rb index 9e69fa2b99..180eeb492c 100644 --- a/app/lib/activitypub/activity/feature_request.rb +++ b/app/lib/activitypub/activity/feature_request.rb @@ -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 diff --git a/app/lib/activitypub/forwarder.rb b/app/lib/activitypub/forwarder.rb index c5ff59fa5a..43bbe013b3 100644 --- a/app/lib/activitypub/forwarder.rb +++ b/app/lib/activitypub/forwarder.rb @@ -20,7 +20,7 @@ class ActivityPub::Forwarder private def payload - @payload ||= Oj.dump(@json) + @payload ||= JSON.generate(@json) end def reblogged_by_account_ids diff --git a/app/lib/webhooks/payload_renderer.rb b/app/lib/webhooks/payload_renderer.rb index a797224496..1be4842cbf 100644 --- a/app/lib/webhooks/payload_renderer.rb +++ b/app/lib/webhooks/payload_renderer.rb @@ -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. diff --git a/app/workers/scheduler/self_destruct_scheduler.rb b/app/workers/scheduler/self_destruct_scheduler.rb index d7aaef56e7..93f8d19f16 100644 --- a/app/workers/scheduler/self_destruct_scheduler.rb +++ b/app/workers/scheduler/self_destruct_scheduler.rb @@ -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] diff --git a/lib/tasks/emojis.rake b/lib/tasks/emojis.rake index 053dfd83bd..3b99a102d1 100644 --- a/lib/tasks/emojis.rake +++ b/lib/tasks/emojis.rake @@ -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