Skip to content

Commit 3211774

Browse files
committed
Format netsplits more correctly if we don't know
This resolves #261 by not interpreting netsplits with an unknown join time as 0. Instead, it's formatted as unknown time. Closes #281.
1 parent a096f2e commit 3211774

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

circe.el

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3208,13 +3208,19 @@ IRC servers."
32083208
(let ((split-time (cadr split)))
32093209
(when (< (+ split-time circe-netsplit-delay)
32103210
(float-time))
3211-
(circe-display 'circe-format-server-netmerge
3212-
:split (car split)
3213-
:time (cadr split)
3214-
:date (current-time-string
3215-
(seconds-to-time (cadr split)))
3216-
:ago (circe-duration-string
3217-
(- (float-time) (cadr split)))))))
3211+
(if (zerop split-time) ; we don't know when they joined
3212+
(circe-display 'circe-format-server-netmerge
3213+
:split (car split)
3214+
:time -1
3215+
:date "?"
3216+
:ago "?")
3217+
(circe-display 'circe-format-server-netmerge
3218+
:split (car split)
3219+
:time split-time
3220+
:date (current-time-string
3221+
(seconds-to-time split-time))
3222+
:ago (circe-duration-string
3223+
(- (float-time) split-time)))))))
32183224
((and (circe-reduce-lurker-spam)
32193225
(circe-lurker-rejoin-p nick circe-chat-target))
32203226
(let* ((channel (irc-connection-channel (circe-server-process)

0 commit comments

Comments
 (0)