-
- if (error->code == TNY_SERVICE_ERROR_CONNECT) {
- gboolean success;
- success = modest_account_mgr_get_server_account_username_has_succeeded (modest_runtime_get_account_mgr (),
- tny_account_get_id (account));
- if (success)
- goto end;
+ gboolean success;
+
+ /* If we get the connection error after establishing a
+ proper connection then do not show the dialog as we
+ are probably behind a firewall, or in a network
+ with connection issues. We just keep this code to
+ detect situations were the user does not enter the
+ server info properly */
+ success = modest_account_mgr_get_server_account_username_has_succeeded (modest_runtime_get_account_mgr (),
+ tny_account_get_id (account));
+
+ if (!success) {
+ gboolean show_banner;
+
+ g_debug ("%s: %s alert received (%s)", __FUNCTION__,
+ (error->code == TNY_SERVICE_ERROR_CONNECT) ? "connect" : "aunthenticate",
+ error->message);
+
+ if (tny_device_is_online (device) &&
+ modest_window_mgr_get_num_windows (modest_runtime_get_window_mgr ()))
+ modest_platform_run_information_dialog (NULL, prompt, TRUE);
+
+ /* Show the account dialog */
+ show_banner = (error->code == TNY_SERVICE_ERROR_CONNECT) ? FALSE : TRUE;
+ g_debug ("%s: going to show settings dialog", __FUNCTION__);
+ show_wrong_password_dialog (self, account, show_banner);
+ retval = TRUE;