+static gboolean
+on_idle_update_folder_counts (gpointer userdata)
+{
+ ModestMailOperation *mail_op;
+ gchar *account_id = (gchar *) userdata;
+
+ mail_op = modest_mail_operation_new (NULL);
+ modest_mail_operation_queue_add (modest_runtime_get_mail_operation_queue (),
+ mail_op);
+ modest_mail_operation_update_folder_counts (mail_op, account_id);
+ g_object_unref (mail_op);
+ g_free (account_id);
+
+ return FALSE;
+
+}
+
+static gint
+on_update_folder_counts (GArray *arguments, gpointer data, osso_rpc_t * retval)
+{
+ osso_rpc_t val;
+ gchar *account_id;
+
+ val = g_array_index (arguments, osso_rpc_t, MODEST_DBUS_SEND_RECEIVE_FULL_ARG_ACCOUNT_ID);
+ account_id = g_strdup (val.value.s);
+
+ if (account_id != NULL) {
+ g_idle_add (on_idle_update_folder_counts, g_strdup (account_id));
+ }
+
+ g_free (account_id);
+
+ return OSSO_OK;
+}
+