mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 05:09:23 +01:00
Fix for bug #846714.
This commit is contained in:
parent
966a09437c
commit
d83cf1450f
@ -67,13 +67,19 @@ class Fun(callbacks.Privmsg):
|
||||
def outFilter(self, irc, msg):
|
||||
if msg.command == 'PRIVMSG':
|
||||
if msg.args[0] in self.outFilters:
|
||||
s = msg.args[1]
|
||||
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
|
||||
msg = ircmsgs.IrcMsg(msg=msg, args=(msg.args[0], 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
|
||||
|
||||
_filterCommands = ['jeffk', 'leet', 'rot13', 'hexlify', 'binary', 'lithp',
|
||||
|
@ -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)
|
||||
@ -126,6 +126,16 @@ class FunTest(ChannelPluginTestCase, PluginDocumentation):
|
||||
self.assertResponse('rot13 foobar', '%s: foobar' % s)
|
||||
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