From 1e49f9e82b8044cf50f487c22775faf62a28b243 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Mon, 6 Dec 2004 23:44:32 +0000 Subject: [PATCH] Fix replies to some dumb/broken CTCP PING implementations. --- plugins/Ctcp.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/plugins/Ctcp.py b/plugins/Ctcp.py index 712bc716d..f742506c8 100644 --- a/plugins/Ctcp.py +++ b/plugins/Ctcp.py @@ -104,9 +104,13 @@ class Ctcp(callbacks.PrivmsgCommandAndRegexp): regexps = ('ctcpPing', 'ctcpVersion', 'ctcpUserinfo', 'ctcpTime', 'ctcpFinger', 'ctcpSource') def ctcpPing(self, irc, msg, match): - "\x01PING (.*)\x01" + "\x01PING ?(.*)\x01" self.log.info('Received CTCP PING from %s', msg.prefix) - self._reply(irc, msg, 'PING %s' % match.group(1)) + payload = match.group(1) + if payload: + self._reply(irc, msg, 'PING %s' % match.group(1)) + else: + self._reply(irc, msg, 'PING') def ctcpVersion(self, irc, msg, match): "\x01VERSION\x01"