From: Jose Dapena Paz Date: Fri, 10 Oct 2008 13:04:42 +0000 (+0000) Subject: Fixed NB#89126: X-Git-Tag: git_migration_finished~1161 X-Git-Url: http://git.maemo.org/git/?p=modest;a=commitdiff_plain;h=a83b1e1a520ddd3b9941faed9e6169910967161b Fixed NB#89126: * Now we use the active account for setting the from field on creating new messages in hildon2 port. * A small fix in the code that finds the account of a from string to make "from:" account detection a bit better. pmo-trunk-r6003 --- diff --git a/src/modest-ui-actions.c b/src/modest-ui-actions.c index 7d3ec7e..6a5a9b6 100644 --- a/src/modest-ui-actions.c +++ b/src/modest-ui-actions.c @@ -715,7 +715,12 @@ modest_ui_actions_compose_msg(ModestWindow *win, if (attachments && modest_platform_check_memory_low (win, TRUE)) goto cleanup; - account_name = modest_account_mgr_get_default_account(mgr); +#ifdef MODEST_TOOLKIT_HILDON2 + account_name = g_strdup (modest_window_get_active_account(win)); +#endif + if (!account_name) { + account_name = modest_account_mgr_get_default_account(mgr); + } if (!account_name) { g_printerr ("modest: no account found\n"); goto cleanup; diff --git a/src/modest-utils.c b/src/modest-utils.c index fb7089d..aceeafb 100644 --- a/src/modest-utils.c +++ b/src/modest-utils.c @@ -764,16 +764,19 @@ modest_utils_get_account_name_from_recipient (const gchar *from_header) if (from) { gchar *from_email = modest_text_utils_get_email_address (from); + gchar *from_header_email = + modest_text_utils_get_email_address (from_header); - if (from_email) { - if (!modest_text_utils_utf8_strcmp (from_header, from_email, TRUE)) { + if (from_email && from_header_email) { + if (!modest_text_utils_utf8_strcmp (from_header_email, from_email, TRUE)) { account_name = g_strdup (node->data); g_free (from); g_free (from_email); break; } - g_free (from_email); } + g_free (from_email); + g_free (from_header_email); g_free (from); } }