summaryrefslogtreecommitdiff
path: root/server.rb
diff options
context:
space:
mode:
authorpdp8 <pdp8@pdp8.info>2023-07-17 21:00:10 +0200
committerpdp8 <pdp8@pdp8.info>2023-07-17 21:00:10 +0200
commit8596528d9c0c07cc46279679f61729a3c06d902e (patch)
tree7fe1dd60cffddbe74488c360c119b87a5b125da1 /server.rb
parent4ca1c5555f18703d1dac673b1a77d1c919fb4787 (diff)
client (un)follow fixed
Diffstat (limited to 'server.rb')
-rw-r--r--server.rb10
1 files changed, 4 insertions, 6 deletions
diff --git a/server.rb b/server.rb
index 1093566..49204a3 100644
--- a/server.rb
+++ b/server.rb
@@ -38,9 +38,9 @@ helpers do
def create
return unless @object
- return if File.readlines(VISITED).collect { |l| l.chomp }.include? @object['id']
+ # return if File.readlines(VISITED).collect { |l| l.chomp }.include? @object['id']
- File.open(VISITED, 'a+') { |f| f.puts @object['id'] }
+ # File.open(VISITED, 'a+') { |f| f.puts @object['id'] }
update_collection INBOX, @object
return unless @object['inReplyTo']
@@ -58,14 +58,12 @@ helpers do
end
def accept
- return unless @object['type'] == 'Follow'
-
+ halt 501 unless @object['type'] == 'Follow'
update_collection FOLLOWING, @object['object']
end
def undo
- return unless @object['type'] == 'Follow'
-
+ halt 501 unless @object['type'] == 'Follow'
update_collection FOLLOWERS, @object['actor'], true
end