* 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
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;
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);
}
}