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

Fixed some bugs with color codes:

- colors are now removed in topic for display in title bar
- completion of /topic command now strips color codes
- color codes are encoded in commands (not only text sent to channel/pv)
- double '%' is replaced by single '%' in command line (when irc_colors_send is ON)
This commit is contained in:
Sebastien Helleu
2005-11-05 11:34:52 +00:00
parent fd562722d0
commit bea5769a05
16 changed files with 1532 additions and 1466 deletions
+20 -1
View File
@@ -481,7 +481,7 @@ int
exec_weechat_command (t_irc_server *server, char *string)
{
int i, argc, return_code, length1, length2;
char *command, *pos, *ptr_args, **argv, *alias_command;
char *command, *pos, *ptr_args, *ptr_args_color, **argv, *alias_command;
t_weechat_alias *ptr_alias;
if ((!string) || (!string[0]) || (string[0] != '/'))
@@ -512,6 +512,15 @@ exec_weechat_command (t_irc_server *server, char *string)
ptr_args = NULL;
}
ptr_args_color = NULL;
if (ptr_args && (cfg_irc_colors_send))
{
ptr_args_color = (char *)gui_color_encode ((unsigned char *)ptr_args);
if (ptr_args_color)
ptr_args = ptr_args_color;
}
#ifdef PLUGINS
if (!plugin_cmd_handler_exec ((server) ? server->name : "", command + 1, ptr_args))
#else
@@ -572,6 +581,8 @@ exec_weechat_command (t_irc_server *server, char *string)
}
free_exploded_string (argv);
free (command);
if (ptr_args_color)
free (ptr_args_color);
return 1;
}
}
@@ -619,6 +630,8 @@ exec_weechat_command (t_irc_server *server, char *string)
_("%s command \"%s\" needs a server connection!\n"),
WEECHAT_ERROR, irc_commands[i].command_name);
free (command);
if (ptr_args_color)
free (ptr_args_color);
return 0;
}
if (irc_commands[i].cmd_function_args)
@@ -637,6 +650,8 @@ exec_weechat_command (t_irc_server *server, char *string)
}
free_exploded_string (argv);
free (command);
if (ptr_args_color)
free (ptr_args_color);
return 1;
}
}
@@ -665,6 +680,8 @@ exec_weechat_command (t_irc_server *server, char *string)
free_exploded_string (argv);
free (command);
if (ptr_args_color)
free (ptr_args_color);
return 1;
}
}
@@ -676,6 +693,8 @@ exec_weechat_command (t_irc_server *server, char *string)
free_exploded_string (argv);
}
free (command);
if (ptr_args_color)
free (ptr_args_color);
return 0;
}