From 3daf30b0a3837d3d8becb0baceed580e92403ce6 Mon Sep 17 00:00:00 2001 From: pdp8 Date: Tue, 25 Jul 2023 00:24:02 +0200 Subject: send notes to outbox --- client.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'client.rb') diff --git a/client.rb b/client.rb index b0b6385..5ef721b 100644 --- a/client.rb +++ b/client.rb @@ -38,6 +38,7 @@ post '/delete' do file = find_file id FileUtils.rm(file) if File.exist? file end + 200 end post '/follow' do @@ -58,14 +59,15 @@ end post '/share' do # TODO protected! - src = find_file INBOX, params['id'] + src = find_file params['id'] object = JSON.parse(File.read(src)) recipients = public recipients << object['attributedTo'] outbox 'Announce', object, recipients - dest = src.sub('/inbox/', '/outbox/') + dest = src.sub('inbox/', 'outbox/') FileUtils.mkdir_p File.dirname(dest) FileUtils.mv src, dest + 200 end post '/login' do -- cgit v1.2.3