3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-27 21:19:31 +01:00

Protocol: abort when receiving SQUIT to our own server

This commit is contained in:
James Lu 2016-08-04 12:55:24 -07:00
parent acd0c673cb
commit 9448bc86fd

View File

@ -1285,10 +1285,15 @@ class Protocol():
def _squit(self, numeric, command, args):
"""Handles incoming SQUITs."""
# <- ABAAE SQ nefarious.midnight.vpn 0 :test
split_server = self._getSid(args[0])
# Normally we'd only need to check for our SID as the SQUIT target, but Nefarious
# actually uses the uplink server as the SQUIT target.
# <- ABAAE SQ nefarious.midnight.vpn 0 :test
if split_server in (self.irc.sid, self.irc.uplink):
raise ProtocolError('SQUIT received: (reason: %s)' % args[-1])
affected_users = []
affected_nicks = []
log.debug('(%s) Splitting server %s (reason: %s)', self.irc.name, split_server, args[-1])