3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-24 03:29:28 +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: else:
modelist.discard(real_mode) modelist.discard(real_mode)
log.debug('(%s) Final modelist: %s', self.name, modelist) log.debug('(%s) Final modelist: %s', self.name, modelist)
if usermodes: try:
self.users[target].modes = modelist if usermodes:
else: self.users[target].modes = modelist
self.channels[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 @staticmethod
def _flip(mode): def _flip(mode):