diff --git a/src/plugins/irc/irc-color.c b/src/plugins/irc/irc-color.c index c19199f97..aead48ee0 100644 --- a/src/plugins/irc/irc-color.c +++ b/src/plugins/irc/irc-color.c @@ -262,74 +262,6 @@ irc_color_decode (const char *string, int keep_colors) return (char *)out; } -/* - * Replaces IRC color codes by codes for command line. - * - * Note: result must be freed after use. - */ - -char * -irc_color_decode_for_user_entry (const char *string) -{ - unsigned char *out, *ptr_string; - int out_length, out_pos, length; - - if (!string) - return NULL; - - out_length = (strlen (string) * 2) + 1; - out = malloc (out_length); - if (!out) - return NULL; - - ptr_string = (unsigned char *)string; - out_pos = 0; - while (ptr_string && ptr_string[0] && (out_pos < out_length - 1)) - { - switch (ptr_string[0]) - { - case IRC_COLOR_BOLD_CHAR: - out[out_pos++] = 0x02; - ptr_string++; - break; - case IRC_COLOR_FIXED_CHAR: - ptr_string++; - break; - case IRC_COLOR_RESET_CHAR: - out[out_pos++] = 0x0F; - ptr_string++; - break; - case IRC_COLOR_REVERSE_CHAR: - out[out_pos++] = 0x16; - ptr_string++; - break; - case IRC_COLOR_ITALIC_CHAR: - out[out_pos++] = 0x1D; - ptr_string++; - break; - case IRC_COLOR_UNDERLINE_CHAR: - out[out_pos++] = 0x1F; - ptr_string++; - break; - case IRC_COLOR_COLOR_CHAR: - out[out_pos++] = 0x03; - ptr_string++; - break; - default: - length = weechat_utf8_char_size ((char *)ptr_string); - if (length == 0) - length = 1; - memcpy (out + out_pos, ptr_string, length); - out_pos += length; - ptr_string += length; - } - } - - out[out_pos] = '\0'; - - return (char *)out; -} - /* * Replaces color codes in command line by IRC color codes. * diff --git a/src/plugins/irc/irc-color.h b/src/plugins/irc/irc-color.h index c8ef4d606..af74dbb60 100644 --- a/src/plugins/irc/irc-color.h +++ b/src/plugins/irc/irc-color.h @@ -87,7 +87,6 @@ #define IRC_COLOR_ITEM_LAG_FINISHED weechat_color(weechat_config_string(irc_config_color_item_lag_finished)) extern char *irc_color_decode (const char *string, int keep_colors); -extern char *irc_color_decode_for_user_entry (const char *string); extern char *irc_color_encode (const char *string, int keep_colors); extern char *irc_color_modifier_cb (void *data, const char *modifier, const char *modifier_data, diff --git a/src/plugins/irc/irc-completion.c b/src/plugins/irc/irc-completion.c index ced451c60..f0a38b043 100644 --- a/src/plugins/irc/irc-completion.c +++ b/src/plugins/irc/irc-completion.c @@ -409,7 +409,7 @@ irc_completion_channel_topic_cb (void *data, const char *completion_item, struct t_gui_buffer *buffer, struct t_gui_completion *completion) { - char *topic, *topic_color; + char *topic; int length; IRC_BUFFER_GET_SERVER_CHANNEL(buffer); @@ -442,12 +442,9 @@ irc_completion_channel_topic_cb (void *data, const char *completion_item, else topic = strdup (ptr_channel->topic); - topic_color = irc_color_decode_for_user_entry ((topic) ? topic : ptr_channel->topic); weechat_hook_completion_list_add (completion, - (topic_color) ? topic_color : ((topic) ? topic : ptr_channel->topic), + (topic) ? topic : ptr_channel->topic, 0, WEECHAT_LIST_POS_SORT); - if (topic_color) - free (topic_color); if (topic) free (topic); }