From 8cb9bc7e4d516a27b4fe27ba0d0a9c40497e003d Mon Sep 17 00:00:00 2001 From: pdp8 Date: Mon, 14 Aug 2023 17:42:57 +0200 Subject: undo/delete activities for outbox posts, cleanup --- server.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'server.rb') diff --git a/server.rb b/server.rb index 4dbfc64..fa4ca2e 100644 --- a/server.rb +++ b/server.rb @@ -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 -- cgit v1.2.3