mirror of
https://github.com/weechat/weechat.git
synced 2026-07-08 02:33:12 +02:00
Added event handlers in plugin list commands outputs (/plugin and script commands)
This commit is contained in:
@@ -2411,6 +2411,23 @@ weechat_cmd_plugin_list (char *name, int full)
|
||||
else
|
||||
gui_printf (NULL, _(" %d defined\n"),
|
||||
handler_found);
|
||||
|
||||
/* event handlers */
|
||||
irc_display_prefix (NULL, NULL, PREFIX_PLUGIN);
|
||||
gui_printf (NULL, _(" event handlers:\n"));
|
||||
handler_found = 0;
|
||||
for (ptr_handler = ptr_plugin->handlers;
|
||||
ptr_handler; ptr_handler = ptr_handler->next_handler)
|
||||
{
|
||||
if (ptr_handler->type == PLUGIN_HANDLER_EVENT)
|
||||
handler_found++;
|
||||
}
|
||||
irc_display_prefix (NULL, NULL, PREFIX_PLUGIN);
|
||||
if (!handler_found)
|
||||
gui_printf (NULL, _(" (no event handler)\n"));
|
||||
else
|
||||
gui_printf (NULL, _(" %d defined\n"),
|
||||
handler_found);
|
||||
|
||||
/* modifiers */
|
||||
irc_display_prefix (NULL, NULL, PREFIX_PLUGIN);
|
||||
|
||||
@@ -2575,6 +2575,25 @@ weechat_lua_cmd (t_weechat_plugin *plugin,
|
||||
if (!handler_found)
|
||||
plugin->print_server (plugin, " (none)");
|
||||
|
||||
/* list Lua event handlers */
|
||||
plugin->print_server (plugin, "");
|
||||
plugin->print_server (plugin, "Lua event handlers:");
|
||||
handler_found = 0;
|
||||
for (ptr_handler = plugin->handlers;
|
||||
ptr_handler; ptr_handler = ptr_handler->next_handler)
|
||||
{
|
||||
if ((ptr_handler->type == PLUGIN_HANDLER_EVENT)
|
||||
&& (ptr_handler->handler_args))
|
||||
{
|
||||
handler_found = 1;
|
||||
plugin->print_server (plugin, " %s => Lua(%s)",
|
||||
ptr_handler->event,
|
||||
ptr_handler->handler_args);
|
||||
}
|
||||
}
|
||||
if (!handler_found)
|
||||
plugin->print_server (plugin, " (none)");
|
||||
|
||||
/* list Lua modifiers */
|
||||
plugin->print_server (plugin, "");
|
||||
plugin->print_server (plugin, "Lua modifiers:");
|
||||
|
||||
@@ -2270,6 +2270,25 @@ weechat_perl_cmd (t_weechat_plugin *plugin,
|
||||
if (!handler_found)
|
||||
plugin->print_server (plugin, " (none)");
|
||||
|
||||
/* list Perl event handlers */
|
||||
plugin->print_server (plugin, "");
|
||||
plugin->print_server (plugin, "Perl event handlers:");
|
||||
handler_found = 0;
|
||||
for (ptr_handler = plugin->handlers;
|
||||
ptr_handler; ptr_handler = ptr_handler->next_handler)
|
||||
{
|
||||
if ((ptr_handler->type == PLUGIN_HANDLER_EVENT)
|
||||
&& (ptr_handler->handler_args))
|
||||
{
|
||||
handler_found = 1;
|
||||
plugin->print_server (plugin, " %s => Perl(%s)",
|
||||
ptr_handler->event,
|
||||
ptr_handler->handler_args);
|
||||
}
|
||||
}
|
||||
if (!handler_found)
|
||||
plugin->print_server (plugin, " (none)");
|
||||
|
||||
/* List Perl modifiers */
|
||||
plugin->print_server (plugin, "");
|
||||
plugin->print_server (plugin, "Python modifiers:");
|
||||
|
||||
@@ -2291,6 +2291,25 @@ weechat_python_cmd (t_weechat_plugin *plugin,
|
||||
}
|
||||
if (!handler_found)
|
||||
plugin->print_server (plugin, " (none)");
|
||||
|
||||
/* list Python event handlers */
|
||||
plugin->print_server (plugin, "");
|
||||
plugin->print_server (plugin, "Python event handlers:");
|
||||
handler_found = 0;
|
||||
for (ptr_handler = plugin->handlers;
|
||||
ptr_handler; ptr_handler = ptr_handler->next_handler)
|
||||
{
|
||||
if ((ptr_handler->type == PLUGIN_HANDLER_EVENT)
|
||||
&& (ptr_handler->handler_args))
|
||||
{
|
||||
handler_found = 1;
|
||||
plugin->print_server (plugin, " %s => Python(%s)",
|
||||
ptr_handler->event,
|
||||
ptr_handler->handler_args);
|
||||
}
|
||||
}
|
||||
if (!handler_found)
|
||||
plugin->print_server (plugin, " (none)");
|
||||
|
||||
/* list Python modifiers */
|
||||
plugin->print_server (plugin, "");
|
||||
|
||||
@@ -2452,6 +2452,25 @@ weechat_ruby_cmd (t_weechat_plugin *plugin,
|
||||
if (!handler_found)
|
||||
plugin->print_server (plugin, " (none)");
|
||||
|
||||
/* list Ruby event handlers */
|
||||
plugin->print_server (plugin, "");
|
||||
plugin->print_server (plugin, "Ruby event handlers:");
|
||||
handler_found = 0;
|
||||
for (ptr_handler = plugin->handlers;
|
||||
ptr_handler; ptr_handler = ptr_handler->next_handler)
|
||||
{
|
||||
if ((ptr_handler->type == PLUGIN_HANDLER_EVENT)
|
||||
&& (ptr_handler->handler_args))
|
||||
{
|
||||
handler_found = 1;
|
||||
plugin->print_server (plugin, " %s => Ruby(%s)",
|
||||
ptr_handler->event,
|
||||
ptr_handler->handler_args);
|
||||
}
|
||||
}
|
||||
if (!handler_found)
|
||||
plugin->print_server (plugin, " (none)");
|
||||
|
||||
/* list Ruby modifiers */
|
||||
plugin->print_server (plugin, "");
|
||||
plugin->print_server (plugin, "Ruby modifiers:");
|
||||
|
||||
Reference in New Issue
Block a user