From bee98f6711bd5d9efecafccb74fb215b4fe091a2 Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Thu, 26 Oct 2017 09:55:52 +0200 Subject: [PATCH] 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 543edccd416f5a45b2a2ee2cc6218264d220bc49. --- plugins/Aka/test.py | 10 +++++++++- plugins/Conditional/plugin.py | 1 - 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/plugins/Aka/test.py b/plugins/Aka/test.py index 9f813ead0..789949490 100644 --- a/plugins/Aka/test.py +++ b/plugins/Aka/test.py @@ -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 diff --git a/plugins/Conditional/plugin.py b/plugins/Conditional/plugin.py index 69ddf0579..dc58ed4bc 100644 --- a/plugins/Conditional/plugin.py +++ b/plugins/Conditional/plugin.py @@ -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