3
0
mirror of https://github.com/jlu5/PyLink.git synced 2025-01-11 20:52:42 +01:00

Merge branch 'staging' into devel

This commit is contained in:
James Lu 2016-03-25 15:03:05 -07:00
commit 03b53aee59
3 changed files with 15 additions and 3 deletions

2
.mailmap Normal file
View File

@ -0,0 +1,2 @@
James Lu <GLolol@overdrivenetworks.com> <GLolol1@hotmail.com>
James Lu <GLolol@overdrivenetworks.com> <GLolol@overdrive.pw>

View File

@ -50,6 +50,8 @@ class Irc():
self.connected = threading.Event()
self.aborted = threading.Event()
self.initVars()
if world.testing:
# HACK: Don't thread if we're running tests.
self.connect()
@ -162,7 +164,6 @@ class Irc():
__init__ in a separate thread to allow multiple concurrent connections.
"""
while True:
self.initVars()
ip = self.serverdata["ip"]
port = self.serverdata["port"]
checks_ok = True
@ -296,6 +297,9 @@ class Irc():
log.debug('(%s) _disconnect: Setting self.aborted to True.', self.name)
self.aborted.set()
log.debug('(%s) disconnect: Clearing state via initVars().', self.name)
self.initVars()
log.debug('(%s) Removing channel logging handlers due to disconnect.', self.name)
while self.loghandlers:
log.removeHandler(self.loghandlers.pop())

View File

@ -214,12 +214,18 @@ def parseModes(irc, target, args):
args = args[1:]
if usermodes:
log.debug('(%s) Using irc.umodes for this query: %s', irc.name, irc.umodes)
assert target in irc.users, "Unknown user %r." % target
if target not in irc.users:
log.warning('(%s) Possible desync! Mode target %s is not in the users index.', irc.name, target)
supported_modes = irc.umodes
oldmodes = irc.users[target].modes
else:
log.debug('(%s) Using irc.cmodes for this query: %s', irc.name, irc.cmodes)
assert target in irc.channels, "Unknown channel %r." % target
if target not in irc.channels:
log.warning('(%s) Possible desync! Mode target %s is not in the channels index.', irc.name, target)
supported_modes = irc.cmodes
oldmodes = irc.channels[target].modes
res = []