summaryrefslogtreecommitdiff
path: root/server.rb
diff options
context:
space:
mode:
Diffstat (limited to 'server.rb')
-rw-r--r--server.rb8
1 files changed, 4 insertions, 4 deletions
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