if (!modest_runtime_init ()) {
g_printerr ("modest: cannot init runtime\n");
return MODEST_ERR_INIT;
+
}
-
account_or_default = check_account (account);
g_free (account);
g_printerr ("modest: cannot start ui\n");
retval = MODEST_ERR_UI;
goto cleanup;
- } else
+ } else {
+ if (modest_conf_get_bool (modest_runtime_get_conf(),
+ MODEST_CONF_CONNECT_AT_STARTUP, NULL))
+ tny_device_force_online (modest_runtime_get_device());
+
retval = start_ui (account_or_default,
mailto, cc, bcc, subject, body);
+ }
} else {
if (!account_or_default) {
g_printerr ("modest: no account has been defined yet\n");
retval = MODEST_ERR_CONF;
goto cleanup;
- }
+ }
retval = send_mail (account_or_default,
mailto, cc, bcc, subject, body);
}
if (!win) {
g_printerr ("modest: failed to create window\n");
return MODEST_ERR_UI;
+ } else {
+ ModestWindowMgr *mgr = modest_runtime_get_window_mgr ();
+ modest_window_mgr_register_window (mgr, win);
}
gtk_widget_show_all (GTK_WIDGET (win));
g_return_val_if_fail (account_name, MODEST_ERR_SEND);
+ ////////////////////// FIXME ////////
+ modest_runtime_not_implemented (NULL);
+ return MODEST_ERR_NONE;
+ //////////////////////////////////////
+
account = TNY_TRANSPORT_ACCOUNT (modest_tny_account_store_get_tny_account_by_account
(modest_runtime_get_account_store(), account_name,
TNY_ACCOUNT_TYPE_TRANSPORT));
mail_operation = modest_mail_operation_new ();
modest_mail_operation_send_new_mail (mail_operation, account,
from_string, mailto,
- cc, bcc, subject, body,
- NULL);
+ cc, bcc, subject, body, NULL,
+ NULL, 0);
if (modest_mail_operation_get_status (mail_operation) ==
MODEST_MAIL_OPERATION_STATUS_FAILED) {
retval = MODEST_ERR_SEND;