From 9380336948a0786053624541d482b8a641231b39 Mon Sep 17 00:00:00 2001 From: James Lu Date: Wed, 30 Aug 2017 21:08:54 -0700 Subject: [PATCH] relay: fall back to the current time on TS-less servers if the remote channel doesn't exist --- plugins/relay.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/relay.py b/plugins/relay.py index 31d5def..fdd86ca 100644 --- a/plugins/relay.py +++ b/plugins/relay.py @@ -676,7 +676,10 @@ def relay_joins(irc, channel, users, ts, **kwargs): if not irc.has_cap('has-ts'): # Special hack for clientbot: just use the remote's modes so mode changes # take precendence. (TS is always outside the clientbot's control) - ts = remoteirc.channels[remotechan].ts + if remotechan in remoteirc.channels: + ts = remoteirc.channels[remotechan].ts + else: + ts = int(time.time()) else: ts = irc.channels[channel].ts prefixes = get_prefix_modes(irc, remoteirc, channel, user)