Fix replies to some dumb/broken CTCP PING implementations.

This commit is contained in:
Jeremy Fincher 2004-12-06 23:44:32 +00:00
parent fee37e43cc
commit 1e49f9e82b

View File

@ -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)
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"