Conditional: Do not use noReply() after running the command.

As the command already calls reply() or noReply(), calling noReply()
there had disastrous effects:

* if reply() was called, noReply() erases the argument
* if noReply() was called, calling noReply() a second time erases **the next argument** (because the current argument was already erased).

This was 'caused' by the change of behavior of noReply() in 543edccd41.
This commit is contained in:
Valentin Lorentz 2017-10-26 09:55:52 +02:00
parent 965dcc293d
commit bee98f6711
2 changed files with 9 additions and 2 deletions

View File

@ -55,7 +55,15 @@ class FunctionsTest(SupyTestCase):
class AkaChannelTestCase(ChannelPluginTestCase):
plugins = ('Aka', 'Conditional', 'Filter', 'Math', 'Utilities',
'Format', 'Reply')
'Format', 'Reply', 'String')
def testHistsearch(self):
self.assertNotError(
r'aka add histsearch "last --from [cif true '
r'\"echo test\" \"echo test\"] '
r'--regexp [concat \"m/$1/\" [re s/g// \"@2\"]]"')
self.assertResponse('echo foo', 'foo')
self.assertResponse('histsearch .*', '@echo foo')
def testDoesNotOverwriteCommands(self):
# We don't have dispatcher commands anymore

View File

@ -83,7 +83,6 @@ class Conditional(callbacks.Plugin):
self._runCommandFunction(irc, msg, ifcommand)
else:
self._runCommandFunction(irc, msg, elsecommand)
irc.noReply()
cif = wrap(cif, [boolean_or_int, 'something', 'something'])
@internationalizeDocstring