diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2012-08-08 11:38:27 +0200 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2012-08-08 11:38:27 +0200 |
commit | 46bc18193397a8a3d5b756f1ffeda8c5f725d9b4 (patch) | |
tree | 8c934b370b6a1743d9e1d24cf6ddf5d9a3d0437e /src/plugins/lua | |
parent | 068d0df56b299d0cc023309c1a6c3cd3fee30bde (diff) | |
download | weechat-46bc18193397a8a3d5b756f1ffeda8c5f725d9b4.zip |
scripts: add signals for scripts loaded/unloaded/installed/removed
Diffstat (limited to 'src/plugins/lua')
-rw-r--r-- | src/plugins/lua/weechat-lua.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/plugins/lua/weechat-lua.c b/src/plugins/lua/weechat-lua.c index a1e9110bb..eed431cdf 100644 --- a/src/plugins/lua/weechat-lua.c +++ b/src/plugins/lua/weechat-lua.c @@ -383,6 +383,9 @@ weechat_lua_load (const char *filename) &weechat_lua_api_buffer_input_data_cb, &weechat_lua_api_buffer_close_cb); + weechat_hook_signal_send ("lua_script_loaded", WEECHAT_HOOK_SIGNAL_STRING, + lua_current_script->filename); + return 1; } @@ -408,6 +411,7 @@ weechat_lua_unload (struct t_plugin_script *script) { int *rc; void *interpreter; + char *filename; if ((weechat_lua_plugin->debug >= 2) || !lua_quiet) { @@ -426,6 +430,7 @@ weechat_lua_unload (struct t_plugin_script *script) free (rc); } + filename = strdup (script->filename); interpreter = script->interpreter; if (lua_current_script == script) @@ -436,6 +441,11 @@ weechat_lua_unload (struct t_plugin_script *script) if (interpreter) lua_close (interpreter); + + weechat_hook_signal_send ("lua_script_unloaded", + WEECHAT_HOOK_SIGNAL_STRING, filename); + if (filename) + free (filename); } /* |