diff options
Diffstat (limited to 'client.rb')
-rw-r--r-- | client.rb | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -10,7 +10,7 @@ end post '/unfollow' do protected! params['id'] = actor params['mention'] if params['mention'] - following = Dir[File.join(OUTBOX[:dir], 'follow', '*.json')].collect { |f| JSON.load_file(f) } + following = Dir[File.join(OUTBOX_DIR, 'follow', '*.json')].collect { |f| JSON.load_file(f) } activity = following.find { |a| a['object'] == params['id'] } activity ||= { '@context' => 'https://www.w3.org/ns/activitystreams', @@ -38,7 +38,8 @@ post '/undo' do # TODO: generalize for announce activity = JSON.load_file(activity_file) next unless activity['id'] == params['id'] - object_file, object = find_object activity['object']['id'] + object_file = File.join(dir, activity['object']['id'].sub('https://', '')) + # object_file, object = find_object activity['object']['id'] create_activity 'Undo', params['id'], activity['to'] FileUtils.rm(activity_file) FileUtils.rm(object_file) |