mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-30 06:49:24 +01:00
Fix for bug #846714.
This commit is contained in:
parent
966a09437c
commit
d83cf1450f
@ -67,12 +67,18 @@ class Fun(callbacks.Privmsg):
|
||||
def outFilter(self, irc, msg):
|
||||
if msg.command == 'PRIVMSG':
|
||||
if msg.args[0] in self.outFilters:
|
||||
if ircmsgs.isAction(msg):
|
||||
s = ircmsgs.unAction(msg)
|
||||
else:
|
||||
s = msg.args[1]
|
||||
methods = self.outFilters[msg.args[0]]
|
||||
for filtercommand in methods:
|
||||
myIrc = MyFunProxy()
|
||||
filtercommand(myIrc, msg, [s])
|
||||
s = myIrc.s
|
||||
if ircmsgs.isAction(msg):
|
||||
msg = ircmsgs.action(msg.args[0], s)
|
||||
else:
|
||||
msg = ircmsgs.IrcMsg(msg=msg, args=(msg.args[0], s))
|
||||
return msg
|
||||
|
||||
|
@ -114,7 +114,7 @@ class FunTest(ChannelPluginTestCase, PluginDocumentation):
|
||||
self.assertNotRegexp('decode asdflkj foobar', 'LookupError')
|
||||
self.assertResponse('decode zlib [encode zlib %s]' % s, s)
|
||||
|
||||
def testoutfilter(self):
|
||||
def testOutfilter(self):
|
||||
s = self.nick.encode('rot13')
|
||||
self.assertNotError('outfilter rot13')
|
||||
self.assertResponse('rot13 foobar', '%s: foobar' % s)
|
||||
@ -127,5 +127,15 @@ class FunTest(ChannelPluginTestCase, PluginDocumentation):
|
||||
self.assertNotError('outfilter')
|
||||
self.assertResponse('rot13 foobar', 'sbbone')
|
||||
|
||||
def testOutfilterAction(self):
|
||||
s = self.nick.encode('rot13')
|
||||
self.assertNotError('outfilter rot13')
|
||||
self.assertResponse('rot13 foobar', '%s: foobar' % s)
|
||||
m = self.getMsg('action foobar')
|
||||
self.failUnless(ircmsgs.isAction(m))
|
||||
s = ircmsgs.unAction(m)
|
||||
self.assertEqual(s, 'sbbone')
|
||||
|
||||
|
||||
|
||||
# vim:set shiftwidth=4 tabstop=8 expandtab textwidth=78:
|
||||
|
Loading…
Reference in New Issue
Block a user