diff --git a/app/models/concerns/status/threading_concern.rb b/app/models/concerns/status/threading_concern.rb index 937090ead16..faa3a37700b 100644 --- a/app/models/concerns/status/threading_concern.rb +++ b/app/models/concerns/status/threading_concern.rb @@ -84,7 +84,11 @@ module Status::ThreadingConcern UNION ALL SELECT - statuses.id, path || statuses.id, authors || statuses.account_id + statuses.id, path || statuses.id, (CASE + WHEN array_length(authors, 1) >= 30 THEN authors + WHEN statuses.account_id = ANY(authors) THEN authors + ELSE authors || statuses.account_id + END) FROM search_tree JOIN