summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2014-02-28 15:07:23 +0100
committerSebastien Helleu <flashcode@flashtux.org>2014-02-28 15:07:23 +0100
commit050d2023d65cc071a65db58a578f7dfef08d3bd4 (patch)
treeefdf7f164eb8efd69dac146ea35b6aeaea37e3c1 /src
parentcf48fa4642d1a309de572ba2e5f179a9b081ab0b (diff)
downloadweechat-050d2023d65cc071a65db58a578f7dfef08d3bd4.zip
irc: fix colors in message with CTCP reply sent to another user
Diffstat (limited to 'src')
-rw-r--r--src/plugins/irc/irc-ctcp.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/plugins/irc/irc-ctcp.c b/src/plugins/irc/irc-ctcp.c
index 06334d67d..9a2ca15d9 100644
--- a/src/plugins/irc/irc-ctcp.c
+++ b/src/plugins/irc/irc-ctcp.c
@@ -278,6 +278,7 @@ irc_ctcp_reply_to_nick (struct t_irc_server *server,
int number;
char hash_key[32];
const char *str_args;
+ char *str_args_color;
hashtable = irc_server_sendf (server,
IRC_SERVER_SEND_OUTQ_PRIO_LOW | IRC_SERVER_SEND_RETURN_HASHTABLE,
@@ -298,6 +299,9 @@ irc_ctcp_reply_to_nick (struct t_irc_server *server,
str_args = weechat_hashtable_get (hashtable, hash_key);
if (!str_args)
break;
+ str_args_color = irc_color_decode (str_args, 1);
+ if (!str_args_color)
+ break;
weechat_printf_tags (irc_msgbuffer_get_target_buffer (server,
nick,
NULL,
@@ -315,9 +319,10 @@ irc_ctcp_reply_to_nick (struct t_irc_server *server,
IRC_COLOR_RESET,
IRC_COLOR_CHAT_CHANNEL,
ctcp,
- (str_args[0]) ? IRC_COLOR_RESET : "",
- (str_args[0]) ? " " : "",
- str_args);
+ (str_args_color[0]) ? IRC_COLOR_RESET : "",
+ (str_args_color[0]) ? " " : "",
+ str_args_color);
+ free (str_args_color);
number++;
}
}