summaryrefslogtreecommitdiff
path: root/client.rb
diff options
context:
space:
mode:
authorpdp8 <pdp8@pdp8.info>2023-09-09 16:02:50 +0200
committerpdp8 <pdp8@pdp8.info>2023-09-09 16:02:50 +0200
commit3a87028b34c969744f6c63ba73947cfa32156e7d (patch)
tree67b46c322a13b5c3c51c0309d71fe6241876a880 /client.rb
parent9ecb046ed70c9431f97eab1d761aa9fb22f8f73c (diff)
update and clean-inbox added, no outbox send for delete, recursive create for objects with activities (lemmy)
Diffstat (limited to 'client.rb')
-rw-r--r--client.rb23
1 files changed, 2 insertions, 21 deletions
diff --git a/client.rb b/client.rb
index 61d1ac3..ca5a338 100644
--- a/client.rb
+++ b/client.rb
@@ -10,27 +10,8 @@ post '/delete' do
protected!
params['id'].each do |id|
file = find_file id
- halt 404 unless file
- # if file.match(%r{outbox/}) # find/delete activity
-
- %w[inbox outbox].each do |box|
- Dir[File.join box, 'announce', '*.json'].each do |announce_file|
- announce = JSON.load_file(announce_file)
- next unless announce['object']['id'] == id
-
- outbox 'Undo', announce, announce['to']
- FileUtils.rm(announce_file)
- end
- Dir[File.join box, 'create', '*.json'].each do |create_file|
- create = JSON.load_file(create_file)
- next unless create['object']['id'] == id
-
- object = JSON.load_file(file)
- outbox 'Delete', object, object['to']
- FileUtils.rm(create_file)
- end
- end
- FileUtils.rm(file) if File.exist? file
+ halt 404 unless file and File.exist?(file)
+ FileUtils.rm(file)
end
200
end