move recursion scan after alias setup, and do another after alias replace
This commit is contained in:
parent
1fe9575502
commit
107b754a0d
|
@ -34,13 +34,6 @@ class Alias(Module):
|
||||||
an internal bot command and run it.
|
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
|
# first see if the aliases are being directly manipulated via add/remove
|
||||||
whats = what.split(' ')
|
whats = what.split(' ')
|
||||||
try:
|
try:
|
||||||
|
@ -69,6 +62,13 @@ class Alias(Module):
|
||||||
except NoOptionError: pass
|
except NoOptionError: pass
|
||||||
except NoSectionError: 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
|
# now that that's over, try doing alias work
|
||||||
try:
|
try:
|
||||||
alias_list = self.config.options(self.__class__.__name__)
|
alias_list = self.config.options(self.__class__.__name__)
|
||||||
|
@ -78,10 +78,14 @@ class Alias(Module):
|
||||||
alias_re = re.compile(alias)
|
alias_re = re.compile(alias)
|
||||||
if alias_re.search(what):
|
if alias_re.search(what):
|
||||||
command = re.sub(alias, self.config.get(self.__class__.__name__, alias), 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
|
# we found an alias for our given string, doing a replace
|
||||||
# each module
|
|
||||||
|
# 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:
|
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:
|
if ret is not None:
|
||||||
# a module had a result for us, post-alias, so return it
|
# a module had a result for us, post-alias, so return it
|
||||||
# TODO: scan all modules with compounding results
|
# TODO: scan all modules with compounding results
|
||||||
|
|
Loading…
Reference in New Issue