* Fixes NB#85378, show the connection specific SMTP and not the account settings...
[modest] / src / modest-ui-actions.c
index fb88cb6..f69a922 100644 (file)
@@ -655,18 +655,6 @@ modest_ui_actions_on_accounts (GtkAction *action,
        }
 }
 
-#ifdef MODEST_PLATFORM_MAEMO
-static void
-on_smtp_servers_window_hide (GtkWindow* window, gpointer user_data)
-{
-       /* Save any changes. */
-       modest_connection_specific_smtp_window_save_server_accounts (
-                       MODEST_CONNECTION_SPECIFIC_SMTP_WINDOW (window));
-       gtk_widget_destroy (GTK_WIDGET (window));
-}
-#endif
-
-
 void
 modest_ui_actions_on_smtp_servers (GtkAction *action, ModestWindow *win)
 {
@@ -682,14 +670,10 @@ modest_ui_actions_on_smtp_servers (GtkAction *action, ModestWindow *win)
                MODEST_CONNECTION_SPECIFIC_SMTP_WINDOW (specific_window), 
                modest_runtime_get_account_mgr());
 
-       /* Show the window: */  
-       gtk_window_set_transient_for (GTK_WINDOW (specific_window), GTK_WINDOW (win));
-       gtk_window_set_modal (GTK_WINDOW (specific_window), TRUE);
+       /* Show the window: */
+       modest_window_mgr_set_modal (modest_runtime_get_window_mgr (), 
+                                    GTK_WINDOW (specific_window));
        gtk_widget_show (specific_window);
-    
-       /* Save changes when the window is hidden: */
-       g_signal_connect (specific_window, "hide", 
-               G_CALLBACK (on_smtp_servers_window_hide), win);
 #endif /* MODEST_PLATFORM_MAEMO */
 }
 
@@ -945,17 +929,28 @@ 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_email);
+                                               g_free (from);
+                                               break;
+                                       }
+                                       g_free (from_email);
                                        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);