From 614b8b87dac068aacc4cf2d6bdcdedfd6b98868e Mon Sep 17 00:00:00 2001 From: James Lu Date: Wed, 9 Aug 2017 16:55:02 -0700 Subject: [PATCH] inspircd: rewrite handle_ping to handle one-arg PING --- protocols/inspircd.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/protocols/inspircd.py b/protocols/inspircd.py index 7277bd9..41a97eb 100644 --- a/protocols/inspircd.py +++ b/protocols/inspircd.py @@ -522,8 +522,10 @@ class InspIRCdProtocol(TS6BaseProtocol): """Handles incoming PING commands, so we don't time out.""" # <- :70M PING 70M 0AL # -> :0AL PONG 0AL 70M - if self.is_internal_server(args[1]): + if len(args) >= 2: self._send_with_prefix(args[1], 'PONG %s %s' % (args[1], source), queue=False) + else: + self._send_with_prefix(self.sid, 'PONG %s' % source, queue=False) def handle_fjoin(self, servernumeric, command, args): """Handles incoming FJOIN commands (InspIRCd equivalent of JOIN/SJOIN)."""