diff options
author | pdp8 <pdp8@pdp8.info> | 2024-05-02 14:34:10 +0200 |
---|---|---|
committer | pdp8 <pdp8@pdp8.info> | 2024-05-02 14:34:10 +0200 |
commit | 97d98fd5481359b96215f8a50d032c8fe96e9add (patch) | |
tree | b02982c19a49c88abe5a727f40831f7a2e344408 /server.rb | |
parent | a0512473ec1c19643dae4889a321602901df79bc (diff) |
VISITED handling
Diffstat (limited to 'server.rb')
-rw-r--r-- | server.rb | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -65,6 +65,8 @@ helpers do save_inbox_object return unless @object and @object['inReplyTo'] and @count < 5 + return if File.readlines(VISITED, chomp: true).include?(@object['inReplyTo']) + # recursive thread download @object = @object['inReplyTo'] @count += 1 @@ -132,7 +134,7 @@ helpers do def handle_activity type = @activity['type'].downcase.to_sym - # save_item @activity, File.join(INBOX[:dir], @activity['type'].downcase, activity_name) + save_item @activity, File.join(INBOX[:dir], @activity['type'].downcase, activity_name) if ACTIVITIES.include? type send(type) else @@ -157,11 +159,11 @@ helpers do # if @activity['type'] != 'Update' && (@object['id'] and File.readlines(VISITED, chomp: true).include? @object['id']) # return # end - if @object['id'] and File.readlines(VISITED, chomp: true).include? @object['id'] - return unless @activity['type'] = 'Update' - - FileUtils.rm_f find_object(@object['id'])[0] - + if @object['id'] and File.readlines(VISITED, chomp: true).include? @object['id'] && !(@activity['type'] = 'Update') + return + # + # FileUtils.rm_f find_object(@object['id'])[0] + # end save_item @object, File.join(INBOX[:dir], 'object', @object['type'].downcase, activity_name) |