Correctly sort messages sent in the same second
This commit is contained in:
parent
8a94a0fa82
commit
79abf15fa8
|
@ -113,8 +113,16 @@
|
|||
(sort
|
||||
(channel-messages irc-dir channel)
|
||||
(lambda (a b)
|
||||
(date>? (alist-ref 'user.chat.date (cdr a))
|
||||
(alist-ref 'user.chat.date (cdr b))))))
|
||||
(let ([date-a (alist-ref 'user.chat.date (cdr a))]
|
||||
[nano-a (alist-ref 'user.chat.date.nanoseconds (cdr a))]
|
||||
[date-b (alist-ref 'user.chat.date (cdr b))]
|
||||
[nano-b (alist-ref 'user.chat.date.nanoseconds (cdr b))])
|
||||
(cond [(and (date=? date-a date-b)
|
||||
nano-a nano-b)
|
||||
(> (string->number nano-b)
|
||||
(string->number nano-a))]
|
||||
[#t
|
||||
(date<? date-b date-a)])))))
|
||||
|
||||
|
||||
(define (channel-online-users irc-dir channel)
|
||||
|
|
Reference in New Issue