X-Git-Url: http://git.maemo.org/git/?p=modest;a=blobdiff_plain;f=src%2Fmodest-text-utils.c;h=99c4bf61c492c6b6832011a838d16b87bbe71111;hp=2b7cbb5abee79cbd60f180ae1dc9a97a1150a095;hb=5f595ed317f7b7c135d411d58c5544fc9fb3dd46;hpb=a3fa613b8f9ff7a21d9dda408086f2145bf54c94 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);