From: Sergio Villar Senin Date: Thu, 25 Jun 2009 11:23:33 +0000 (+0200) Subject: Fixes NB#124324, remove the original instance of "Fw:" in any of its forms ("FW:... X-Git-Tag: 3.0.17-rc20~7 X-Git-Url: http://git.maemo.org/git/?p=modest;a=commitdiff_plain;h=5f595ed317f7b7c135d411d58c5544fc9fb3dd46 Fixes NB#124324, remove the original instance of "Fw:" in any of its forms ("FW:", "Fw:"...) --- diff --git a/src/modest-text-utils.c b/src/modest-text-utils.c index 2b7cbb5..99c4bf6 100644 --- a/src/modest-text-utils.c +++ b/src/modest-text-utils.c @@ -316,7 +316,23 @@ modest_text_utils_derived_subject (const gchar *subject, const gchar *prefix) tmp += prefix_len; tmp = g_strchug (tmp); } else { - break; + gchar *prefix_down, *tmp_down; + + /* We need this to properly check the cases of + some clients adding FW: instead of Fw: for + example */ + prefix_down = g_utf8_strdown (prefix, -1); + tmp_down = g_utf8_strdown (tmp, -1); + if (g_str_has_prefix (tmp_down, prefix_down)) { + tmp += prefix_len; + tmp = g_strchug (tmp); + g_free (prefix_down); + g_free (tmp_down); + } else { + g_free (prefix_down); + g_free (tmp_down); + break; + } } } while (tmp);