From c02f32070cf3cf01acb82db6a833d89c66d36056 Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Fri, 1 Jan 2010 17:15:22 +0100 Subject: Fix buffer used to display IRC notice sent to channel or nick (bug #28455) --- src/plugins/irc/irc-command.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/plugins/irc/irc-command.c b/src/plugins/irc/irc-command.c index 79d0789f2..ecd4cadd5 100644 --- a/src/plugins/irc/irc-command.c +++ b/src/plugins/irc/irc-command.c @@ -2234,6 +2234,7 @@ irc_command_notice (void *data, struct t_gui_buffer *buffer, int argc, { char *string; int arg_nick, arg_text; + struct t_irc_channel *ptr_channel; IRC_GET_SERVER(buffer); @@ -2255,9 +2256,12 @@ irc_command_notice (void *data, struct t_gui_buffer *buffer, int argc, string = irc_color_decode (argv_eol[arg_text], weechat_config_boolean (irc_config_network_colors_receive)); - weechat_printf (ptr_server->buffer, - "Notice -> %s%s%s: %s", - IRC_COLOR_CHAT_NICK, + ptr_channel = irc_channel_search (ptr_server, argv[arg_nick]); + weechat_printf ((ptr_channel) ? ptr_channel->buffer : ptr_server->buffer, + "%sNotice -> %s%s%s: %s", + weechat_prefix ("network"), + (irc_channel_is_channel (argv[arg_nick])) ? + IRC_COLOR_CHAT_CHANNEL : IRC_COLOR_CHAT_NICK, argv[arg_nick], IRC_COLOR_CHAT, (string) ? string : argv_eol[arg_text]); -- cgit v1.2.3