481 |
exec_weechat_command (t_irc_server *server, char *string) |
exec_weechat_command (t_irc_server *server, char *string) |
482 |
{ |
{ |
483 |
int i, argc, return_code, length1, length2; |
int i, argc, return_code, length1, length2; |
484 |
char *command, *pos, *ptr_args, **argv, *alias_command; |
char *command, *pos, *ptr_args, *ptr_args_color, **argv, *alias_command; |
485 |
t_weechat_alias *ptr_alias; |
t_weechat_alias *ptr_alias; |
486 |
|
|
487 |
if ((!string) || (!string[0]) || (string[0] != '/')) |
if ((!string) || (!string[0]) || (string[0] != '/')) |
512 |
ptr_args = NULL; |
ptr_args = NULL; |
513 |
} |
} |
514 |
|
|
515 |
|
ptr_args_color = NULL; |
516 |
|
|
517 |
|
if (ptr_args && (cfg_irc_colors_send)) |
518 |
|
{ |
519 |
|
ptr_args_color = (char *)gui_color_encode ((unsigned char *)ptr_args); |
520 |
|
if (ptr_args_color) |
521 |
|
ptr_args = ptr_args_color; |
522 |
|
} |
523 |
|
|
524 |
#ifdef PLUGINS |
#ifdef PLUGINS |
525 |
if (!plugin_cmd_handler_exec ((server) ? server->name : "", command + 1, ptr_args)) |
if (!plugin_cmd_handler_exec ((server) ? server->name : "", command + 1, ptr_args)) |
526 |
#else |
#else |
581 |
} |
} |
582 |
free_exploded_string (argv); |
free_exploded_string (argv); |
583 |
free (command); |
free (command); |
584 |
|
if (ptr_args_color) |
585 |
|
free (ptr_args_color); |
586 |
return 1; |
return 1; |
587 |
} |
} |
588 |
} |
} |
630 |
_("%s command \"%s\" needs a server connection!\n"), |
_("%s command \"%s\" needs a server connection!\n"), |
631 |
WEECHAT_ERROR, irc_commands[i].command_name); |
WEECHAT_ERROR, irc_commands[i].command_name); |
632 |
free (command); |
free (command); |
633 |
|
if (ptr_args_color) |
634 |
|
free (ptr_args_color); |
635 |
return 0; |
return 0; |
636 |
} |
} |
637 |
if (irc_commands[i].cmd_function_args) |
if (irc_commands[i].cmd_function_args) |
650 |
} |
} |
651 |
free_exploded_string (argv); |
free_exploded_string (argv); |
652 |
free (command); |
free (command); |
653 |
|
if (ptr_args_color) |
654 |
|
free (ptr_args_color); |
655 |
return 1; |
return 1; |
656 |
} |
} |
657 |
} |
} |
680 |
|
|
681 |
free_exploded_string (argv); |
free_exploded_string (argv); |
682 |
free (command); |
free (command); |
683 |
|
if (ptr_args_color) |
684 |
|
free (ptr_args_color); |
685 |
return 1; |
return 1; |
686 |
} |
} |
687 |
} |
} |
693 |
free_exploded_string (argv); |
free_exploded_string (argv); |
694 |
} |
} |
695 |
free (command); |
free (command); |
696 |
|
if (ptr_args_color) |
697 |
|
free (ptr_args_color); |
698 |
return 0; |
return 0; |
699 |
} |
} |
700 |
|
|