all repos — honk @ afef1d2849f4a53e0dffaa99efa91beb8b7dad11

my fork of honk

sort chatter
Ted Unangst tedu@tedunangst.com
Sat, 23 May 2020 19:32:32 -0400
commit

afef1d2849f4a53e0dffaa99efa91beb8b7dad11

parent

0c27f3dfb4b17c77f8395cbf55cb75f4e58b7f96

1 files changed, 11 insertions(+), 0 deletions(-)

jump to
M database.godatabase.go

@@ -586,6 +586,17 @@ Target: target,

Chonks: chonks, }) } + sort.Slice(chatter, func(i, j int) bool { + a, b := chatter[i], chatter[j] + if len(a.Chonks) == 0 || len(b.Chonks) == 0 { + if len(a.Chonks) == len(b.Chonks) { + return a.Target < b.Target + } + return len(a.Chonks) > len(b.Chonks) + } + return a.Chonks[len(a.Chonks)-1].Date.After(b.Chonks[len(b.Chonks)-1].Date) + }) + return chatter }