3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-12-25 04:02:45 +01:00

ts6: fixes to SQUIT handling

This commit is contained in:
James Lu 2015-10-10 14:58:52 -07:00
parent 8258923cdb
commit 1f0426d7ff
2 changed files with 5 additions and 3 deletions

View File

@ -288,7 +288,7 @@ class TS6Protocol(TS6BaseProtocol):
def squitServer(self, source, target, text='No reason given'):
"""SQUITs a PyLink server."""
# -> SQUIT 9PZ :blah, blah
self.irc.send('SQUIT %s :%s' % (target, text))
self._send(source, 'SQUIT %s :%s' % (target, text))
self.handle_squit(source, 'SQUIT', [target, text])
def connect(self):

View File

@ -162,8 +162,10 @@ class TS6BaseProtocol(Protocol):
# :70M SQUIT 1ML :Server quit by GL!gl@0::1
split_server = args[0]
affected_users = []
log.info('(%s) Netsplit on server %s', self.irc.name, split_server)
assert split_server in self.irc.servers, "Tried to split a server (%s) that didn't exist!" % split_server
log.debug('(%s) Splitting server %s (reason: %s)', self.irc.name, split_server, args[-1])
if split_server not in self.irc.servers:
log.warning("(%s) Tried to split a server (%s) that didn't exist!", self.irc.name, split_server)
return
# Prevent RuntimeError: dictionary changed size during iteration
old_servers = self.irc.servers.copy()
for sid, data in old_servers.items():