From b5965d05a200dc4eaa62de2ee379b631952be554 Mon Sep 17 00:00:00 2001 From: Erik O'Leary Date: Wed, 13 Nov 2013 13:20:45 -0600 Subject: [PATCH] Added timestamp to TIRCEvent --- lib/pure/irc.nim | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/pure/irc.nim b/lib/pure/irc.nim index 74ad7e26a9..ee85d9c691 100644 --- a/lib/pure/irc.nim +++ b/lib/pure/irc.nim @@ -98,6 +98,7 @@ type params*: seq[string] ## Parameters of the IRC message origin*: string ## The channel/user that this msg originated from raw*: string ## Raw IRC message + timestamp*: TTime ## UNIX epoch time the message was received proc send*(irc: PIRC, message: string, sendImmediately = false) = ## Sends ``message`` as a raw command. It adds ``\c\L`` for you. @@ -160,9 +161,10 @@ proc isNumber(s: string): bool = result = i == s.len and s.len > 0 proc parseMessage(msg: string): TIRCEvent = - result.typ = EvMsg - result.cmd = MUnknown - result.raw = msg + result.typ = EvMsg + result.cmd = MUnknown + result.raw = msg + result.timestamp = times.getTime() var i = 0 # Process the prefix if msg[i] == ':':