about summary refs log tree commit diff stats
path: root/widgets
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2019-09-18 10:21:45 -0400
committerDrew DeVault <sir@cmpwn.com>2019-09-18 10:21:45 -0400
commit956f1366a538f4cbd0f300083871196c4c759d44 (patch)
tree52a6585250dc04ea861abac37e80b504b9d34f49 /widgets
parent35dc57ed90f8c26fd2f792b312934acdcaaf5269 (diff)
downloadaerc-956f1366a538f4cbd0f300083871196c4c759d44.tar.gz
Revert "Fix out-of-order messages by sorting as we display"
This reverts commit ac99d9ed62644cf0259bdd79481b28c3fbcef650.
Diffstat (limited to 'widgets')
-rw-r--r--widgets/msglist.go31
1 files changed, 0 insertions, 31 deletions
diff --git a/widgets/msglist.go b/widgets/msglist.go
index b7c921c..5c2d2f4 100644
--- a/widgets/msglist.go
+++ b/widgets/msglist.go
@@ -3,7 +3,6 @@ package widgets
 import (
 	"fmt"
 	"log"
-	"sort"
 
 	"github.com/gdamore/tcell"
 	"github.com/mattn/go-runewidth"
@@ -28,34 +27,6 @@ type MessageList struct {
 	aerc          *Aerc
 }
 
-type msgSorter struct {
-	uids  []uint32
-	store *lib.MessageStore
-}
-
-func (s *msgSorter) Len() int {
-	return len(s.uids)
-}
-
-func (s *msgSorter) Less(i, j int) bool {
-	msgI := s.store.Messages[s.uids[i]]
-	msgJ := s.store.Messages[s.uids[j]]
-	if msgI == nil && msgJ == nil {
-		return false // doesn't matter which order among nulls
-	} else if msgI == nil && msgJ != nil {
-		return true // say i is before j so we sort i to bottom
-	} else if msgI != nil && msgJ == nil {
-		return false // say i is after j so we sort j to bottom
-	}
-	return msgI.InternalDate.Before(msgJ.InternalDate)
-}
-
-func (s *msgSorter) Swap(i, j int) {
-	tmp := s.uids[i]
-	s.uids[i] = s.uids[j]
-	s.uids[j] = tmp
-}
-
 func NewMessageList(conf *config.AercConfig, logger *log.Logger, aerc *Aerc) *MessageList {
 	ml := &MessageList{
 		conf:          conf,
@@ -97,8 +68,6 @@ func (ml *MessageList) Draw(ctx *ui.Context) {
 		row          int = 0
 	)
 	uids := store.Uids()
-	sorter := msgSorter{uids: uids, store: store}
-	sort.Stable(&sorter)
 
 	for i := len(uids) - 1 - ml.scroll; i >= 0; i-- {
 		uid := uids[i]