X-Git-Url: http://git.maemo.org/git/?p=modest;a=blobdiff_plain;f=src%2Fmodest-ui-actions.c;h=e4f50be1d7154af19bb07bb4351484b2c03e9204;hp=fb88cb6fcd69aacd1b344aecb601c0a245731614;hb=b33ec96de3833b9be96d3e8a82a4e3d535cf59a1;hpb=2a6e3e308c8d806d105f995de43a9cbd2bfdd644 diff --git a/src/modest-ui-actions.c b/src/modest-ui-actions.c index fb88cb6..e4f50be 100644 --- a/src/modest-ui-actions.c +++ b/src/modest-ui-actions.c @@ -945,17 +945,26 @@ open_msg_cb (ModestMailOperation *mail_op, if (from_header) { GSList *accounts = modest_account_mgr_account_names (mgr, TRUE); GSList *node = NULL; + gchar *from_header_email; + + from_header_email = modest_text_utils_get_email_address ((const gchar *) from_header); + for (node = accounts; node != NULL; node = g_slist_next (node)) { - gchar *from = modest_account_mgr_get_from_string (mgr, node->data); + gchar *from, *from_email; - if (from && (strcmp (from_header, from) == 0)) { - g_free (account); - account = g_strdup (node->data); + from = modest_account_mgr_get_from_string (mgr, node->data); + if (from) { + from_email = modest_text_utils_get_email_address ((const gchar *) from); + if (strcmp (from_header_email, from_email) == 0) { + g_free (account); + account = g_strdup (node->data); + g_free (from); + break; + } g_free (from); - break; } - g_free (from); } + g_free (from_header_email); g_free (from_header); g_slist_foreach (accounts, (GFunc) g_free, NULL); g_slist_free (accounts);