diff options
Diffstat (limited to 'server.rb')
-rw-r--r-- | server.rb | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -1,5 +1,3 @@ -# frozen_string_literal: true - # server-server post '/inbox' do request.body.rewind # in case someone already read it @@ -26,7 +24,7 @@ end get '/outbox' do files = Dir[File.join('outbox', 'create', '*.json')] + Dir[File.join('outbox', 'announce', '*.json')] - activities = files.collect { |f| JSON.parse(File.read(f)) } + activities = files.collect { |f| JSON.load_file(f) } ids = activities.sort_by { |a| a['published'] }.collect { |a| a['id'] } { '@context' => 'https://www.w3.org/ns/activitystreams', 'id' => 'https://social.pdp8.info/outbox', @@ -155,7 +153,7 @@ helpers do next if [ACTOR, 'https://www.w3.org/ns/activitystreams#Public'].include? url if url == FOLLOWERS_URL - JSON.parse(File.read(FOLLOWERS))['orderedItems'].each do |follower| + JSON.load_file(FOLLOWERS)['orderedItems'].each do |follower| inboxes << actor_inbox(follower) end next |