From 06850ff6fb31b4e6f04bf4e6672bb40114967bb5 Mon Sep 17 00:00:00 2001 From: Eric Budd Date: Tue, 21 Sep 2021 23:58:43 -0500 Subject: [PATCH] Fix reply ordering bug --- iris.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/iris.rb b/iris.rb index 4ca45de..dc4c31e 100755 --- a/iris.rb +++ b/iris.rb @@ -550,7 +550,9 @@ class Message # Find all messages replying to the current topic, including replies to topics # which have been edited. def replies - (Corpus.find_all_by_parent_hash(hash) + ((edit_predecessor && edit_predecessor.replies) || [])).compact + all_replies = Corpus.find_all_by_parent_hash(hash) + all_replies += ((edit_predecessor && edit_predecessor.replies) || []) + all_replies.compact.sort_by{ |reply| Corpus.index_of(reply) } end def id