3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-27 13:09:23 +01:00

relay: fall back to the current time on TS-less servers if the remote channel doesn't exist

This commit is contained in:
James Lu 2017-08-30 21:08:54 -07:00
parent 136e5fbee7
commit 9380336948

View File

@ -676,7 +676,10 @@ def relay_joins(irc, channel, users, ts, **kwargs):
if not irc.has_cap('has-ts'): if not irc.has_cap('has-ts'):
# Special hack for clientbot: just use the remote's modes so mode changes # Special hack for clientbot: just use the remote's modes so mode changes
# take precendence. (TS is always outside the clientbot's control) # 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: else:
ts = irc.channels[channel].ts ts = irc.channels[channel].ts
prefixes = get_prefix_modes(irc, remoteirc, channel, user) prefixes = get_prefix_modes(irc, remoteirc, channel, user)