From efed7d8081af161f1ca0e3735f5f0ceddfcb871e Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Thu, 19 Jan 2023 10:31:13 +0100 Subject: [PATCH] Move the 'ignore=False' trick from callbacks to Scheduler I fear putting it in callbacks would be overzealous and reset it within the processing of the same message, eg. when using conditional to set the 'ignore' tag before other nested commands run. --- plugins/Scheduler/plugin.py | 7 +++++++ src/callbacks.py | 7 ------- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/plugins/Scheduler/plugin.py b/plugins/Scheduler/plugin.py index 104344153..91d4ca907 100644 --- a/plugins/Scheduler/plugin.py +++ b/plugins/Scheduler/plugin.py @@ -148,6 +148,13 @@ class Scheduler(callbacks.Plugin): channel=msg.channel, network=irc.network) if remove: del self.events[str(f.eventId)] + + # A previous run of the command may have set 'ignored' to True, + # causing this run to not include response from nested commands; + # as NestedCommandsIrcProxy.reply() would confuse it with the + # subcommand setting 'ignored' to True itself. + msg.tag('ignored', False) + self.Proxy(irc, msg, tokens) return f diff --git a/src/callbacks.py b/src/callbacks.py index 85f4d8020..97f6a1eca 100644 --- a/src/callbacks.py +++ b/src/callbacks.py @@ -996,13 +996,6 @@ class NestedCommandsIrcProxy(ReplyIrcProxy): # work, but we're being careful. self.args = copy.deepcopy(args) - # Another trick needed for Scheduler: - # A previous run of the command may have set 'ignored' to True, - # causing this run to not include response from nested commands; - # as NestedCommandsIrcProxy.reply() would confuse it with the - # subcommand setting 'ignored' to True itself. - msg.tag('ignored', False) - self.counter = 0 self._resetReplyAttributes() if not args: