diff options
author | pdp8 <pdp8@pdp8.info> | 2023-07-25 00:24:02 +0200 |
---|---|---|
committer | pdp8 <pdp8@pdp8.info> | 2023-07-25 00:24:02 +0200 |
commit | 3daf30b0a3837d3d8becb0baceed580e92403ce6 (patch) | |
tree | 8e0ac2d67a0ead3e0bd324088485618927858bb2 /client.rb | |
parent | 0f039c1b813653869033e961810942f479a28685 (diff) |
send notes to outbox
Diffstat (limited to 'client.rb')
-rw-r--r-- | client.rb | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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 |