summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2007-03-29 12:44:42 +0000
committerSebastien Helleu <flashcode@flashtux.org>2007-03-29 12:44:42 +0000
commitbad4bd0bef050b3a3b370c66efce0be0097ebfcc (patch)
tree98ef2196470dccd061852a837c7ac1a013fb1dcb /src
parent0872e77872adb973f694ed8221e5e9faeb73d6e9 (diff)
downloadweechat-bad4bd0bef050b3a3b370c66efce0be0097ebfcc.zip
Fixed color bug with IRC messages displayed by plugins (bug #19442)
Diffstat (limited to 'src')
-rw-r--r--src/plugins/plugins-interface.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/plugins/plugins-interface.c b/src/plugins/plugins-interface.c
index 439f1295c..c54caac70 100644
--- a/src/plugins/plugins-interface.c
+++ b/src/plugins/plugins-interface.c
@@ -166,7 +166,7 @@ weechat_plugin_print (t_weechat_plugin *plugin,
t_gui_buffer *ptr_buffer;
va_list argptr;
static char buf[8192];
- char *buf2;
+ char *buf2, *buf3;
if (!plugin || !message)
return;
@@ -177,10 +177,14 @@ 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", (buf2) ? buf2 : buf);
+ gui_printf (ptr_buffer, "%s\n", (buf3) ? buf3 : ((buf2) ? buf2 : buf));
if (buf2)
free (buf2);
+ if (buf3)
+ free (buf3);
}
/*
@@ -192,7 +196,7 @@ weechat_plugin_print_server (t_weechat_plugin *plugin, char *message, ...)
{
va_list argptr;
static char buf[8192];
- char *buf2;
+ char *buf2, *buf3;
if (!plugin || !message)
return;
@@ -202,10 +206,14 @@ 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", (buf2) ? buf2 : buf);
+ gui_printf (NULL, "%s\n", (buf3) ? buf3 : ((buf2) ? buf2 : buf));
if (buf2)
free (buf2);
+ if (buf3)
+ free (buf3);
}
/*