From: Sergio Villar Senin Date: Wed, 10 Sep 2008 12:21:46 +0000 (+0000) Subject: Reverted commit 5419 as it prevented notifications from appear X-Git-Tag: git_migration_finished~1193 X-Git-Url: http://git.maemo.org/git/?p=modest;a=commitdiff_plain;h=d33107e7927e5f03a6329b27f8cfd013fe62e787 Reverted commit 5419 as it prevented notifications from appear pmo-trunk-r5533 --- diff --git a/src/dbus_api/modest-dbus-callbacks.c b/src/dbus_api/modest-dbus-callbacks.c index d34e7e8..3432018 100644 --- a/src/dbus_api/modest-dbus-callbacks.c +++ b/src/dbus_api/modest-dbus-callbacks.c @@ -885,6 +885,8 @@ on_idle_send_receive(gpointer user_data) return FALSE; } + + static gint on_dbus_method_dump_send_queues (DBusConnection *con, DBusMessage *message) { @@ -1076,11 +1078,20 @@ on_dbus_method_dump_accounts (DBusConnection *con, DBusMessage *message) return OSSO_OK; } -static gint -on_send_receive(GArray *arguments, gpointer data, osso_rpc_t * retval) -{ +static void +on_send_receive_performer(gboolean canceled, + GError *err, + GtkWindow *parent_window, + TnyAccount *account, + gpointer user_data) +{ ModestConnectedVia connect_when; + if (err || canceled) { + g_idle_add (notify_error_in_dbus_callback, NULL); + return; + } + connect_when = modest_conf_get_int (modest_runtime_get_conf (), MODEST_CONF_UPDATE_WHEN_CONNECTED_BY, NULL); @@ -1094,6 +1105,18 @@ on_send_receive(GArray *arguments, gpointer data, osso_rpc_t * retval) /* We need this to allow modest to finish */ g_idle_add (notify_error_in_dbus_callback, NULL); } +} + + +static gint +on_send_receive(GArray *arguments, gpointer data, osso_rpc_t * retval) +{ + TnyDevice *device = modest_runtime_get_device (); + + if (!tny_device_is_online (device)) + modest_platform_connect_and_perform (NULL, FALSE, NULL, on_send_receive_performer, NULL); + else + on_send_receive_performer (FALSE, NULL, NULL, NULL, NULL); return OSSO_OK; }