diff options
author | pdp8 <pdp8@pdp8.info> | 2024-07-14 23:21:15 +0200 |
---|---|---|
committer | pdp8 <pdp8@pdp8.info> | 2024-07-14 23:21:15 +0200 |
commit | a9b6e7f9011bbf006fb86d1974b9b8ce8293c6b8 (patch) | |
tree | 57cc9eb262a6dd4d46518c743a230509eefda7db /server.rb | |
parent | ffade03e9d3f77e41f44882c39eb6b12b3b05e63 (diff) |
outbox formatting
Diffstat (limited to 'server.rb')
-rw-r--r-- | server.rb | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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 |