summaryrefslogtreecommitdiff
path: root/server.rb
diff options
context:
space:
mode:
authorpdp8 <pdp8@pdp8.info>2023-08-14 17:42:57 +0200
committerpdp8 <pdp8@pdp8.info>2023-08-14 17:42:57 +0200
commit8cb9bc7e4d516a27b4fe27ba0d0a9c40497e003d (patch)
treea6d9626b248849a5d620e644144880d8febb1df1 /server.rb
parent9781dda58c3d2926f928544a8155d493fc2f1ca2 (diff)
undo/delete activities for outbox posts, cleanup
Diffstat (limited to 'server.rb')
-rw-r--r--server.rb6
1 files changed, 2 insertions, 4 deletions
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