From a9b6e7f9011bbf006fb86d1974b9b8ce8293c6b8 Mon Sep 17 00:00:00 2001 From: pdp8 Date: Sun, 14 Jul 2024 23:21:15 +0200 Subject: outbox formatting --- server.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'server.rb') diff --git a/server.rb b/server.rb index b202624..d9983ef 100644 --- a/server.rb +++ b/server.rb @@ -44,7 +44,7 @@ get '/pdp8' do end get '/.well-known/webfinger' do - halt 404 unless request['resource'] == "acct:#{MENTION}" + halt 404 unless request.params['resource'] == "acct:#{MENTION}" send_file(WEBFINGER, type: 'application/jrd+json') end @@ -72,7 +72,7 @@ helpers do return end - save_item @object, INBOX_DIR + save_inbox @object File.open(VISITED, 'a+') { |f| f.puts @object['id'] } return unless @object and @object['inReplyTo'] and @count < 5 @@ -120,7 +120,7 @@ helpers do when 'Follow' update_collection FOLLOWERS, @activity['object']['actor'], 'delete' when 'Create', 'Announce' - file = File.join(dir, @activity['object']['id'].sub('https://', '')) + file = File.join(INBOX_DIR, @activity['object']['id'].sub('https://', '')) # file, object = find_object @activity['object']['object'] FileUtils.rm(file) if file and File.exist? file # and @activity['actor'] == object['attributedTo'] else @@ -136,7 +136,7 @@ helpers do end def delete - file = File.join(dir, @activity['object']['id'].sub('https://', '')) + file = File.join(INBOX_DIR, @activity['object']['id'].sub('https://', '')) # file, object = find_object(@activity['object']['id']) FileUtils.rm(file) if file and File.exist? file # and @activity['actor'] == @activity['object']['attributedTo'] end -- cgit v1.2.3