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.
This commit is contained in:
Valentin Lorentz 2023-01-19 10:31:13 +01:00
parent f409111872
commit efed7d8081
2 changed files with 7 additions and 7 deletions

View File

@ -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

View File

@ -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: