diff options
author | Dominik Picheta <dominikpicheta@googlemail.com> | 2012-12-01 16:38:33 +0000 |
---|---|---|
committer | Dominik Picheta <dominikpicheta@googlemail.com> | 2012-12-01 16:38:33 +0000 |
commit | 10d13d5032bd1109207a9feb9f487ad5d7e102de (patch) | |
tree | be29c6fa9abd52291e573b9f3a31f2a9965dd827 /lib | |
parent | 336da8f44e28da0cc4f51933f52b836f7e2e9c59 (diff) | |
download | Nim-10d13d5032bd1109207a9feb9f487ad5d7e102de.tar.gz |
Fixed IRC test.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pure/irc.nim | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/pure/irc.nim b/lib/pure/irc.nim index 11808ca33..8916681f7 100644 --- a/lib/pure/irc.nim +++ b/lib/pure/irc.nim @@ -281,8 +281,8 @@ proc processLine(irc: PIRC, line: string): TIRCEvent = result.typ = EvDisconnected return - #if result.cmd == MPing: - # irc.send("PONG " & result.params[0]) + if result.cmd == MPing: + irc.send("PONG " & result.params[0]) if result.cmd == MPong: irc.lag = epochTime() - parseFloat(result.params[result.params.high]) irc.lastPong = epochTime() @@ -300,9 +300,9 @@ proc processLine(irc: PIRC, line: string): TIRCEvent = proc processOther(irc: PIRC, ev: var TIRCEvent): bool = result = false - #if epochTime() - irc.lastPing >= 20.0: - # irc.lastPing = epochTime() - # irc.send("PING :" & formatFloat(irc.lastPing), true) + if epochTime() - irc.lastPing >= 20.0: + irc.lastPing = epochTime() + irc.send("PING :" & formatFloat(irc.lastPing), true) if epochTime() - irc.lastPong >= 120.0 and irc.lastPong != -1.0: irc.close() @@ -463,6 +463,8 @@ when isMainModule: var event: TIRCEvent if client.poll(event): case event.typ + of EvConnected: + nil of EvDisconnected: break of EvMsg: |