Skip to content

Commit 112a3e5

Browse files
committed
Work around ZNC giving incorrect server-times for 001
1 parent cd6de1f commit 112a3e5

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/commands/handlers/registration.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,9 @@ var handlers = {
1818

1919
handler.network.cap.negotiating = false;
2020

21-
let time = command.getServerTime();
22-
if (time) {
23-
handler.network.addServerTimeOffset(time);
24-
} else if (handler.network.cap.isEnabled('server-time')) {
21+
// We can't use the time given here as ZNC actually replays the time when it first connects
22+
// to an IRC server, not now(). Send a PING so that we can get a reliable time from PONG
23+
if (handler.network.cap.isEnabled('server-time')) {
2524
// Ping to try get a server-time in its response as soon as possible
2625
handler.connection.write('PING ' + Date.now());
2726
}

0 commit comments

Comments
 (0)