diff -r 43e777a5ff06 -r 61a54e172010 mcabber/src/hooks.c --- a/mcabber/src/hooks.c Sat Nov 10 22:28:16 2007 +0100 +++ b/mcabber/src/hooks.c Sat Nov 10 22:29:31 2007 +0100 @@ -31,6 +31,7 @@ #include "settings.h" #include "utils.h" #include "utf8.h" +#include "commands.h" static char *extcmd; @@ -332,6 +333,29 @@ } +/* Internal commands */ + +void hook_execute_internal(const char *hookname) +{ + const char *hook_command; + char *buf; + char *cmdline; + + hook_command = settings_opt_get(hookname); + if (!hook_command) + return; + + buf = g_strdup_printf("Running %s...", hookname); + scr_LogPrint(LPRINT_LOGNORM, "%s", buf); + + cmdline = g_strdup_printf(mkcmdstr("%s"), hook_command); + process_command(hook_command, TRUE); // XXX Note: /quit won't work. + + g_free(cmdline); + g_free(buf); +} + + /* External commands */ // hk_ext_cmd_init()