summaryrefslogtreecommitdiff
path: root/server.rb
diff options
context:
space:
mode:
Diffstat (limited to 'server.rb')
-rw-r--r--server.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/server.rb b/server.rb
index 9fd9e11..7319efa 100644
--- a/server.rb
+++ b/server.rb
@@ -64,16 +64,19 @@ end
helpers do
def create
+ @count ||= 0
@object ||= @activity['object']
+
@object = if @object['type'] == 'Like' # lemmy likes
save_object @object['object'], INBOX
else
save_object @object, INBOX
end
- return unless @object and @object['inReplyTo']
+ return unless @object and @object['inReplyTo'] and @count < 5
# recursive thread download
@object = @object['inReplyTo']
+ @count += 1
create
end
@@ -100,7 +103,7 @@ helpers do
when 'Follow'
update_collection FOLLOWERS, @activity['object']['actor'], true
when 'Create', 'Announce'
- file = find_file @activity['object']['id']
+ file = find_file @activity['object']['object']
FileUtils.rm(file) if file
else
halt 501