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