Merge remote-tracking branch 'origin/pr/615'

This commit is contained in:
Sébastien Helleu 2019-08-10 11:12:13 +02:00
commit dd133af522

View File

@ -2802,7 +2802,7 @@ IRC_PROTOCOL_CALLBACK(wallops)
IRC_PROTOCOL_CALLBACK(001)
{
char *server_command, **commands, **ptr_command, *vars_replaced, *away_msg;
char *usermode;
char *usermode, *slash_command;
IRC_PROTOCOL_MIN_ARGS(3);
@ -2870,8 +2870,23 @@ IRC_PROTOCOL_CALLBACK(001)
{
vars_replaced = irc_message_replace_vars (server, NULL,
*ptr_command);
weechat_command (server->buffer,
(vars_replaced) ? vars_replaced : *ptr_command);
if (weechat_string_is_command_char (*ptr_command))
{
weechat_command (server->buffer,
(vars_replaced) ? vars_replaced : *ptr_command);
}
else
{
slash_command = malloc (1 + strlen((vars_replaced) ? vars_replaced : *ptr_command) + 1);
if (slash_command)
{
strcpy (slash_command, "/");
strcat (slash_command, (vars_replaced) ? vars_replaced : *ptr_command);
weechat_command (server->buffer, slash_command);
free (slash_command);
}
}
if (vars_replaced)
free (vars_replaced);
}