Bug 329702 - Allow code to hook all commands as well as individual ones.

ChatZilla only.
r=samuel
This commit is contained in:
silver%warwickcompsoc.co.uk 2006-03-18 15:20:32 +00:00
Родитель 550b0aee03
Коммит 911241a85c
1 изменённых файлов: 9 добавлений и 3 удалений

Просмотреть файл

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