]> cat aescling's git repositories - mastodon.git/commitdiff
Turns out that replies don't have to have the type comment. Changed handling
authorEugen Rochko <eugen@zeonfederated.com>
Sat, 19 Mar 2016 10:59:23 +0000 (11:59 +0100)
committerEugen Rochko <eugen@zeonfederated.com>
Sat, 19 Mar 2016 10:59:23 +0000 (11:59 +0100)
of those to depend on presence of <thr:in-reply-to /> instead

app/services/process_feed_service.rb

index 7f72ea251d95c92bf9f59d8b02f82088cc4a17be..ccdf07cc112679c0e9712b3e945a1ad11d39704d 100644 (file)
@@ -26,12 +26,14 @@ class ProcessFeedService < BaseService
 
       status = Status.new(uri: activity_id(entry), url: activity_link(entry), account: account, text: content(entry), created_at: published(entry), updated_at: updated(entry))
 
-      if object_type(entry) == :comment && verb(entry) == :post
-        add_reply!(entry, status)
-      elsif verb(entry) == :share
+      if verb(entry) == :share
         add_reblog!(entry, status)
       elsif verb(entry) == :post
-        add_post!(entry, status)
+        if thread_id(entry).nil?
+          add_post!(entry, status)
+        else
+          add_reply!(entry, status)
+        end
       end
 
       # If we added a status, go through accounts it mentions and create respective relations