Bug 329702 - Allow code to hook all commands as well as individual ones.
ChatZilla only. r=samuel git-svn-id: svn://10.0.0.236/trunk@192593 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
34e94f6857
commit
346f283ee0
@ -647,8 +647,10 @@ function dispatchCommand (command, e, flags)
|
||||
}
|
||||
else
|
||||
{
|
||||
if ("beforeHooks" in client.commandManager)
|
||||
callHooks(client.commandManager, true);
|
||||
if ("beforeHooks" in e.command)
|
||||
callHooks (e.command, true);
|
||||
callHooks(e.command, true);
|
||||
|
||||
if ("dbgDispatch" in client && client.dbgDispatch)
|
||||
{
|
||||
@ -677,8 +679,10 @@ function dispatchCommand (command, e, flags)
|
||||
else if (typeof e.command.func == "string")
|
||||
{
|
||||
/* dispatch an alias (semicolon delimited list of subcommands) */
|
||||
if ("beforeHooks" in client.commandManager)
|
||||
callHooks(client.commandManager, true);
|
||||
if ("beforeHooks" in e.command)
|
||||
callHooks (e.command, true);
|
||||
callHooks(e.command, true);
|
||||
|
||||
var commandList;
|
||||
//Don't make use of e.inputData if we have multiple commands in 1 alias
|
||||
@ -722,7 +726,9 @@ function dispatchCommand (command, e, flags)
|
||||
}
|
||||
|
||||
if ("afterHooks" in e.command)
|
||||
callHooks (e.command, false);
|
||||
callHooks(e.command, false);
|
||||
if ("afterHooks" in client.commandManager)
|
||||
callHooks(client.commandManager, false);
|
||||
|
||||
return ("returnValue" in e) ? e.returnValue : null;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user