1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-02 15:53:12 +02:00

Renamed PLUGIN_* macros and fixed bug in "IRC::add_message_handler" function

This commit is contained in:
Sebastien Helleu
2003-11-22 16:55:56 +00:00
parent 7779b2f78e
commit ba65f5ec30
8 changed files with 48 additions and 38 deletions
+7 -6
View File
@@ -135,21 +135,22 @@ static XS (XS_IRC_add_command_handler)
{
char *name, *function;
int integer;
t_plugin_handler *ptr_plugin_handler;
dXSARGS;
name = SvPV (ST (0), integer);
function = SvPV (ST (1), integer);
if (index_command_search (name))
if (!index_command_search (name))
index_command_new (name);
ptr_plugin_handler = plugin_handler_search (plugin_cmd_handlers, name);
if (ptr_plugin_handler)
{
gui_printf (gui_current_window,
_("Perl error: alias or command \"%s\" already exists!\n"),
name);
free (ptr_plugin_handler->function_name);
ptr_plugin_handler->function_name = strdup (function);
}
else
{
plugin_handler_add (&plugin_cmd_handlers, &last_plugin_cmd_handler,
PLUGIN_PERL, name, function);
}
XSRETURN_EMPTY;
}