* set a new default account when removing the current one
[modest] / src / modest-main.c
index 324465c..bd59104 100644 (file)
@@ -227,6 +227,7 @@ start_ui (const gchar *account_name, const gchar* mailto, const gchar *cc, const
        } else {
                ModestWindowMgr *mgr = modest_runtime_get_window_mgr ();
                modest_window_mgr_register_window (mgr, win);
+               g_object_unref (win);
        }
        
        gtk_widget_show_all (GTK_WIDGET (win));
@@ -283,11 +284,13 @@ send_mail (const gchar* account_name,
        from_string = modest_account_mgr_get_from_string (modest_runtime_get_account_mgr(),
                                                          account_name);
 
-       mail_operation = modest_mail_operation_new ();
+       mail_operation = modest_mail_operation_new (MODEST_MAIL_OPERATION_TYPE_SEND, NULL);
+
        modest_mail_operation_send_new_mail (mail_operation, account,
+                                            NULL,
                                             from_string, mailto,
-                                            cc, bcc, subject, body, NULL,
-                                            NULL, 0);
+                                            cc, bcc, subject, body, NULL /* html_body */,
+                                            NULL /* attachments */, 0 /* priority */);
        if (modest_mail_operation_get_status (mail_operation) == 
            MODEST_MAIL_OPERATION_STATUS_FAILED) {
                retval = MODEST_ERR_SEND;