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

inspircd: fix sending ping replies from subservers

This commit is contained in:
James Lu 2019-11-17 10:48:58 -08:00
parent 7bf1a9e08d
commit 8a48d4d8cc

View File

@ -661,12 +661,17 @@ class InspIRCdProtocol(TS6BaseProtocol):
def handle_ping(self, source, command, args): def handle_ping(self, source, command, args):
"""Handles incoming PING commands, so we don't time out.""" """Handles incoming PING commands, so we don't time out."""
# InspIRCd 2:
# <- :70M PING 70M 0AL # <- :70M PING 70M 0AL
# -> :0AL PONG 0AL 70M # -> :0AL PONG 0AL 70M
# InspIRCd 3:
# <- :3IN PING 808
# -> :808 PONG 3IN
if len(args) >= 2: if len(args) >= 2:
self._send_with_prefix(args[1], 'PONG %s %s' % (args[1], source), queue=False) self._send_with_prefix(args[1], 'PONG %s %s' % (args[1], source), queue=False)
else: else:
self._send_with_prefix(self.sid, 'PONG %s' % source, queue=False) self._send_with_prefix(args[0], 'PONG %s' % source, queue=False)
def handle_fjoin(self, servernumeric, command, args): def handle_fjoin(self, servernumeric, command, args):
"""Handles incoming FJOIN commands (InspIRCd equivalent of JOIN/SJOIN).""" """Handles incoming FJOIN commands (InspIRCd equivalent of JOIN/SJOIN)."""