diff options
author | pdp8 <pdp8@pdp8.info> | 2023-10-06 15:02:59 +0200 |
---|---|---|
committer | pdp8 <pdp8@pdp8.info> | 2023-10-06 15:02:59 +0200 |
commit | 580c684f792d6fab16c58b9a08d566cd03c72ca4 (patch) | |
tree | b6cda32267d02c5e5118fa2d6b1da92c48c457c6 /client.rb | |
parent | 6100f9971b74ee4d3449155beb881a69017a296d (diff) |
announce to fixed, find_file replaced with find_object, CONTENT_LENGHT included in signature verification
Diffstat (limited to 'client.rb')
-rw-r--r-- | client.rb | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -41,12 +41,11 @@ end post '/share' do # TODO protected! - src = find_file params['id'] + src, object = find_object params['id'] object = JSON.load_file(src) - recipients = ['https://www.w3.org/ns/activitystreams#Public'] - recipients += JSON.load_file(FOLLOWERS)['orderedItems'] - recipients << object['attributedTo'] - create_activity 'Announce', object, recipients + to = ['https://www.w3.org/ns/activitystreams#Public', FOLLOWERS_URL] + to << object['attributedTo'] + create_activity 'Announce', object, to dest = src.sub('inbox/', 'outbox/') FileUtils.mkdir_p File.dirname(dest) FileUtils.mv src, dest @@ -59,7 +58,7 @@ post '/undo' do # TODO: generalize for announce activity = JSON.load_file(activity_file) next unless activity['id'] == params['id'] - object_file = find_file activity['object']['id'] + object_file, object = find_object activity['object']['id'] create_activity 'Undo', params['id'], activity['to'] FileUtils.rm(activity_file) FileUtils.rm(object_file) |