From 107b754a0dd3e53b99dfe540b771295ef00af27d Mon Sep 17 00:00:00 2001 From: "Brian S. Stephan" Date: Fri, 17 Dec 2010 16:12:45 -0600 Subject: [PATCH] move recursion scan after alias setup, and do another after alias replace --- modules/Alias.py | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/modules/Alias.py b/modules/Alias.py index 9cab20e..f5e6339 100644 --- a/modules/Alias.py +++ b/modules/Alias.py @@ -34,13 +34,6 @@ class Alias(Module): an internal bot command and run it. """ - # search for recursions, which will search for recursions, which ... - what = self.try_recursion(connection, event, nick, userhost, None, what, admin_unlocked) - - # done searching for recursions in this level. we will now operate on - # whatever recursion-satisfied string we have, checking for alias and - # running module commands - # first see if the aliases are being directly manipulated via add/remove whats = what.split(' ') try: @@ -69,6 +62,13 @@ class Alias(Module): except NoOptionError: pass except NoSectionError: pass + # search for recursions, which will search for recursions, which ... + what = self.try_recursion(connection, event, nick, userhost, None, what, admin_unlocked) + + # done searching for recursions in this level. we will now operate on + # whatever recursion-satisfied string we have, checking for alias and + # running module commands + # now that that's over, try doing alias work try: alias_list = self.config.options(self.__class__.__name__) @@ -78,10 +78,14 @@ class Alias(Module): alias_re = re.compile(alias) if alias_re.search(what): command = re.sub(alias, self.config.get(self.__class__.__name__, alias), what) - # we found an alias for our given string, doing a replace and running it against - # each module + # we found an alias for our given string, doing a replace + + # need to do another recursion scan + command = self.try_recursion(connection, event, nick, userhost, None, command, admin_unlocked) + + # running it against each module for module in self.modlist: - ret = module.do(connection, event, nick, userhost, replypath, command, admin_unlocked) + ret = module.do(connection, event, nick, userhost, None, command, admin_unlocked) if ret is not None: # a module had a result for us, post-alias, so return it # TODO: scan all modules with compounding results