]> cat aescling's git repositories - mastodon.git/commitdiff
Sort self-replies to the top of the thread (#9296)
authorEugen Rochko <eugen@zeonfederated.com>
Fri, 16 Nov 2018 18:34:10 +0000 (19:34 +0100)
committerGitHub <noreply@github.com>
Fri, 16 Nov 2018 18:34:10 +0000 (19:34 +0100)
Fix #6463

app/models/concerns/status_threading_concern.rb

index fa441469c11c80766bea1baf62313106e8ae2f01..234cfd5d24f460e4e3984427f691c029909043c3 100644 (file)
@@ -86,6 +86,9 @@ module StatusThreadingConcern
 
     # Order ancestors/descendants by tree path
     statuses.sort_by! { |status| ids.index(status.id) }
+
+    # Bring self-replies to the top
+    statuses.sort_by! { |status| status.in_reply_to_account_id == status.account_id ? -1 : 0 }
   end
 
   def relations_map_for_account(account, account_ids, domains)