diff options
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 |