diff options
author | pdp8 <pdp8@pdp8.info> | 2023-07-17 21:00:10 +0200 |
---|---|---|
committer | pdp8 <pdp8@pdp8.info> | 2023-07-17 21:00:10 +0200 |
commit | 8596528d9c0c07cc46279679f61729a3c06d902e (patch) | |
tree | 7fe1dd60cffddbe74488c360c119b87a5b125da1 /server.rb | |
parent | 4ca1c5555f18703d1dac673b1a77d1c919fb4787 (diff) |
client (un)follow fixed
Diffstat (limited to 'server.rb')
-rw-r--r-- | server.rb | 10 |
1 files changed, 4 insertions, 6 deletions
@@ -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 |