diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2007-07-12 15:00:45 +0000 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2007-07-12 15:00:45 +0000 |
commit | 241f70f869c9d04ad13fdaa8b53ba57067426e8b (patch) | |
tree | 84c615ab66fb2b90eeabefcf7360fe9eb3db63ee /src/plugins | |
parent | 9d5ef17bd66a91b8023e428e316d039e31f5f858 (diff) | |
download | weechat-241f70f869c9d04ad13fdaa8b53ba57067426e8b.zip |
Fixed bugs with IRC color in messages, now color codes are inserted in command line with ^Cc,^Cb,.. instead of %C,%B,.. (bug #20222, task #7060)
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/plugins-interface.c | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/src/plugins/plugins-interface.c b/src/plugins/plugins-interface.c index e2ee26fff..e980f1d4c 100644 --- a/src/plugins/plugins-interface.c +++ b/src/plugins/plugins-interface.c @@ -165,7 +165,7 @@ weechat_plugin_print (t_weechat_plugin *plugin, t_gui_buffer *ptr_buffer; va_list argptr; static char buf[8192]; - char *buf2, *buf3; + char *buf2; if (!plugin || !message) return; @@ -176,14 +176,10 @@ weechat_plugin_print (t_weechat_plugin *plugin, va_end (argptr); buf2 = weechat_iconv_to_internal (plugin->charset, buf); - buf3 = (char *)gui_color_decode ((unsigned char *)((buf2) ? buf2 : buf), - cfg_irc_colors_receive); irc_display_prefix (NULL, ptr_buffer, PREFIX_PLUGIN); - gui_printf (ptr_buffer, "%s\n", (buf3) ? buf3 : ((buf2) ? buf2 : buf)); + gui_printf_keep_colors (ptr_buffer, "%s\n", (buf2) ? buf2 : buf); if (buf2) free (buf2); - if (buf3) - free (buf3); } /* @@ -195,7 +191,7 @@ weechat_plugin_print_server (t_weechat_plugin *plugin, char *message, ...) { va_list argptr; static char buf[8192]; - char *buf2, *buf3; + char *buf2; if (!plugin || !message) return; @@ -205,14 +201,10 @@ weechat_plugin_print_server (t_weechat_plugin *plugin, char *message, ...) va_end (argptr); buf2 = weechat_iconv_to_internal (plugin->charset, buf); - buf3 = (char *)gui_color_decode ((unsigned char *)((buf2) ? buf2 : buf), - cfg_irc_colors_receive); irc_display_prefix (NULL, NULL, PREFIX_PLUGIN); - gui_printf (NULL, "%s\n", (buf3) ? buf3 : ((buf2) ? buf2 : buf)); + gui_printf_keep_colors (NULL, "%s\n", (buf2) ? buf2 : buf); if (buf2) free (buf2); - if (buf3) - free (buf3); } /* @@ -1420,7 +1412,7 @@ weechat_plugin_get_buffer_data (t_weechat_plugin *plugin, char *server, char *ch new_buffer_line->nick = (ptr_line->nick) ? strdup (ptr_line->nick) : NULL; if (ptr_line->data) { - data1 = (char *) gui_color_decode ((unsigned char *)(ptr_line->data + ptr_line->ofs_start_message), 0); + data1 = (char *) gui_color_decode ((unsigned char *)(ptr_line->data + ptr_line->ofs_start_message), 0, 0); data2 = (data1) ? weechat_iconv_from_internal (plugin->charset, data1) : NULL; if (data2) new_buffer_line->data = data2; |