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

Irc: warn when applyModes target doesn't exist

This can happen when a network disconnects while spawnClient is setting modes on a newly spawned client, for example...
This commit is contained in:
James Lu 2016-07-05 00:41:15 -07:00
parent 5ef135d888
commit f8ca65cabc

View File

@ -644,10 +644,13 @@ class Irc():
else:
modelist.discard(real_mode)
log.debug('(%s) Final modelist: %s', self.name, modelist)
if usermodes:
self.users[target].modes = modelist
else:
self.channels[target].modes = modelist
try:
if usermodes:
self.users[target].modes = modelist
else:
self.channels[target].modes = modelist
except KeyError:
log.warning("(%s) Invalid MODE target %s (usermodes=%s)", self.name, target, usermodes)
@staticmethod
def _flip(mode):