The set_pass_func is not always the last to set
[modest] / src / modest-tny-account.c
index 33c8013..ac3c94e 100644 (file)
@@ -167,12 +167,10 @@ on_connection_status_changed (TnyAccount *account, TnyConnectionStatus status, g
                 * because tinymail does not guarantee that this signal handler will be called 
                 * in the main thread.
                 */
-               /* TODO: Commented out (and setting offline instead), because this causes hangs, probably related to 
+               /* TODO: Commented out, because this causes hangs, probably related to 
                 * our use of mainloops:
                 * modest_platform_connect_and_wait (NULL);
                 */
-                TnyDevice *device = modest_runtime_get_device ();
-                tny_device_force_offline (device);
        } else if (status == TNY_CONNECTION_STATUS_CONNECTED_BROKEN) {
                printf ("DEBUG: %s: Connection broken. Forcing TnyDevice offline.\n", 
                        __FUNCTION__);
@@ -184,8 +182,13 @@ on_connection_status_changed (TnyAccount *account, TnyConnectionStatus status, g
                 * When libconic reconnects, it will set the device back online again,
                 * regardless of it being forced offline before.
                 */
+               /* TODO: Find out when this is falsely being emitted. */
+               printf ("  DEBUG: %s: Not forcing offline because tinymail is sometimes reporting false connection breaks.\n", 
+                       __FUNCTION__);
+               /*
                TnyDevice *device = modest_runtime_get_device ();
                tny_device_force_offline (device);
+               */
        }
 }
 
@@ -482,19 +485,20 @@ modest_tny_account_new_from_account (ModestAccountMgr *account_mgr, const gchar
                modest_account_mgr_free_account_data (account_mgr, account_data);
                return NULL;
        }
-       
+
+
+       /* This name is what shows up in the folder view -- so for some POP/IMAP/... server
+        * account, we set its name to the account of which it is part. */
+       if (account_data->display_name)
+               tny_account_set_name (tny_account, account_data->display_name);
+
        tny_account_set_forget_pass_func (tny_account,
                                          forget_pass_func ? forget_pass_func : forget_pass_dummy);
        tny_account_set_pass_func (tny_account,
                                   get_pass_func ? get_pass_func: get_pass_dummy);
        
 
-        /* This name is what shows up in the folder view -- so for some POP/IMAP/... server
-       *  account, we set its name to the account of which it is part. */
-
-        if (account_data->display_name)
-                tny_account_set_name (tny_account, account_data->display_name);
-
         modest_tny_account_set_parent_modest_account_name_for_server_account (tny_account, account_name);
 
         modest_account_mgr_free_account_data (account_mgr, account_data);