diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2008-12-19 17:43:37 +0100 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2008-12-19 17:43:37 +0100 |
commit | 13e3f3c7f04a805568ebb9a044d81d1eb32aedd6 (patch) | |
tree | 2cd321253a56b5a7f3ee7bca61a5cb90f3692a97 /src/plugins/charset/charset.c | |
parent | b97db3c31e10e75815d78d5a510953c63fcc2dbf (diff) | |
download | weechat-13e3f3c7f04a805568ebb9a044d81d1eb32aedd6.zip |
Fix charset problem with IRC plugin: use server charset if channel charset is not set
Diffstat (limited to 'src/plugins/charset/charset.c')
-rw-r--r-- | src/plugins/charset/charset.c | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/src/plugins/charset/charset.c b/src/plugins/charset/charset.c index 8e95925e5..487fec0ab 100644 --- a/src/plugins/charset/charset.c +++ b/src/plugins/charset/charset.c @@ -390,7 +390,7 @@ charset_command_cb (void *data, struct t_gui_buffer *buffer, int argc, struct t_config_section *ptr_section; int length; char *ptr_charset, *option_name; - const char *plugin_name, *name; + const char *plugin_name, *name, *charset_modifier; /* make C compiler happy */ (void) data; @@ -407,13 +407,20 @@ charset_command_cb (void *data, struct t_gui_buffer *buffer, int argc, plugin_name = weechat_buffer_get_string (buffer, "plugin"); name = weechat_buffer_get_string (buffer, "name"); - - length = strlen (plugin_name) + 1 + strlen (name) + 1; - option_name = malloc (length); - if (!option_name) - return WEECHAT_RC_ERROR; - - snprintf (option_name, length, "%s.%s", plugin_name, name); + + charset_modifier = weechat_buffer_get_string (buffer, + "localvar_charset_modifier"); + if (charset_modifier) + option_name = strdup (charset_modifier); + else + { + length = strlen (plugin_name) + 1 + strlen (name) + 1; + option_name = malloc (length); + if (!option_name) + return WEECHAT_RC_ERROR; + + snprintf (option_name, length, "%s.%s", plugin_name, name); + } if ((argc > 1) && (weechat_strcasecmp (argv[1], "reset") == 0)) { |