From: Eugen Rochko Date: Fri, 16 Nov 2018 18:34:10 +0000 (+0100) Subject: Sort self-replies to the top of the thread (#9296) X-Git-Url: https://git.xn--scling-oua.cat.family/?a=commitdiff_plain;h=074960bb0fa59664c0ae1a35ef80301f5033700d;p=mastodon.git Sort self-replies to the top of the thread (#9296) Fix #6463 --- diff --git a/app/models/concerns/status_threading_concern.rb b/app/models/concerns/status_threading_concern.rb index fa441469c..234cfd5d2 100644 --- a/app/models/concerns/status_threading_concern.rb +++ b/app/models/concerns/status_threading_concern.rb @@ -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)