From 8596528d9c0c07cc46279679f61729a3c06d902e Mon Sep 17 00:00:00 2001 From: pdp8 Date: Mon, 17 Jul 2023 21:00:10 +0200 Subject: client (un)follow fixed --- server.rb | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'server.rb') 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 -- cgit v1.2.3