This commit is contained in:
Jeremy Fincher 2003-10-21 23:21:32 +00:00
parent 0769c0a586
commit f09928e5cd
2 changed files with 10 additions and 0 deletions

View File

@ -201,6 +201,8 @@ class MoobotFactoids(callbacks.PrivmsgCommandAndRegexp):
def _checkFactoids(self, irc, msg, _):
# Strip the bot name
key = callbacks.addressed(irc.nick, msg)
if key.startswith('\x01'):
return
# Check the factoid db for an appropriate reply
cursor = self.db.cursor()
cursor.execute("""SELECT fact FROM factoids WHERE key = %s""", key)

View File

@ -189,6 +189,14 @@ if sqlite is not None:
self.assertResponse('echo foo is bar', 'foo is bar')
self.assertNoResponse(' ', 3)
def testNoResponseToCtcp(self):
self.assertNotError('foo is bar')
self.assertResponse('foo', 'foo is bar')
self.irc.feedMsg(ircmsgs.privmsg(self.irc.nick, '\x01VERSION\x01'))
m = self.irc.takeMsg()
self.failIf(m)
class DunnoTestCase(PluginTestCase, PluginDocumentation):
plugins = ('Misc', 'MoobotFactoids', 'User')
def setUp(self):