summaryrefslogtreecommitdiff
path: root/idc_irc_proxy.py
diff options
context:
space:
mode:
Diffstat (limited to 'idc_irc_proxy.py')
-rwxr-xr-xidc_irc_proxy.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/idc_irc_proxy.py b/idc_irc_proxy.py
index d946fe1..1faa5f2 100755
--- a/idc_irc_proxy.py
+++ b/idc_irc_proxy.py
@@ -5,7 +5,7 @@
# © 2022 by luk3yx
#
-import miniirc, miniirc_idc, os, socket, threading, traceback
+import datetime, miniirc, miniirc_idc, os, socket, threading, traceback
from concurrent.futures import ThreadPoolExecutor
from miniirc_extras.utils import (ircv2_message_unparser, ircv3_message_parser,
ircv3_message_unparser)
@@ -88,12 +88,19 @@ class Proxy:
args = [args[0], args[-1][6:]]
elif cmd == 'PRIVMSG' and ('\n' in args[-1] or '\r' in args[-1]):
message = args[-1].replace('\r\n', '\n').replace('\r', '\n')
+ if 'time' not in tags:
+ tags = {
+ 'time': datetime.datetime.utcnow().isoformat(
+ timespec='milliseconds'
+ ) + 'Z',
+ **tags
+ }
for i, line in enumerate(message.split('\n', 9)):
if i > 0:
line = '\u200b' + line
self.send(cmd, hostmask, tags, [args[0], line])
if i == 0:
- tags = {}
+ tags = {'time': tags['time']}
return
# Send the command to the client