summaryrefslogtreecommitdiff
path: root/client.rb
diff options
context:
space:
mode:
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