mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-30 14:14:37 +01:00
Fixed RFE #827285.
This commit is contained in:
parent
0769c0a586
commit
f09928e5cd
@ -201,6 +201,8 @@ class MoobotFactoids(callbacks.PrivmsgCommandAndRegexp):
|
|||||||
def _checkFactoids(self, irc, msg, _):
|
def _checkFactoids(self, irc, msg, _):
|
||||||
# Strip the bot name
|
# Strip the bot name
|
||||||
key = callbacks.addressed(irc.nick, msg)
|
key = callbacks.addressed(irc.nick, msg)
|
||||||
|
if key.startswith('\x01'):
|
||||||
|
return
|
||||||
# Check the factoid db for an appropriate reply
|
# Check the factoid db for an appropriate reply
|
||||||
cursor = self.db.cursor()
|
cursor = self.db.cursor()
|
||||||
cursor.execute("""SELECT fact FROM factoids WHERE key = %s""", key)
|
cursor.execute("""SELECT fact FROM factoids WHERE key = %s""", key)
|
||||||
|
@ -189,6 +189,14 @@ if sqlite is not None:
|
|||||||
self.assertResponse('echo foo is bar', 'foo is bar')
|
self.assertResponse('echo foo is bar', 'foo is bar')
|
||||||
self.assertNoResponse(' ', 3)
|
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):
|
class DunnoTestCase(PluginTestCase, PluginDocumentation):
|
||||||
plugins = ('Misc', 'MoobotFactoids', 'User')
|
plugins = ('Misc', 'MoobotFactoids', 'User')
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user