summaryrefslogtreecommitdiff
path: root/client.rb
diff options
context:
space:
mode:
authorpdp8 <pdp8@pdp8.info>2023-07-25 00:24:02 +0200
committerpdp8 <pdp8@pdp8.info>2023-07-25 00:24:02 +0200
commit3daf30b0a3837d3d8becb0baceed580e92403ce6 (patch)
tree8e0ac2d67a0ead3e0bd324088485618927858bb2 /client.rb
parent0f039c1b813653869033e961810942f479a28685 (diff)
send notes to outbox
Diffstat (limited to 'client.rb')
-rw-r--r--client.rb6
1 files changed, 4 insertions, 2 deletions
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