2007-06-07 Murray Cumming <murrayc@murrayc.com>
authorMurray Cumming <murrayc@murrayc.com>
Thu, 7 Jun 2007 08:11:07 +0000 (08:11 +0000)
committerMurray Cumming <murrayc@murrayc.com>
Thu, 7 Jun 2007 08:11:07 +0000 (08:11 +0000)
* src/modest-account-mgr-helpers.c: (get_security_for_conf_string),
        (modest_server_account_set_security):
        * src/modest-defs.h: Add comments explaining that our
        UI spec means TLS when it says Normal, so these do not look like errors.

        * src/modest-tny-account.c:
        (modest_tny_account_new_from_server_account): Use the new tinymail
        'wrapped' option for regular SSL, and use the new tinymail 'tls' option
        for TLS. This should fix projects.maemo.org bug NB#58460.

pmo-trunk-r2092

ChangeLog2
src/modest-account-mgr-helpers.c
src/modest-defs.h
src/modest-tny-account.c

index 71efd1d..aa7f76a 100644 (file)
@@ -1,3 +1,15 @@
+2007-06-07  Murray Cumming  <murrayc@murrayc.com>
+
+       * src/modest-account-mgr-helpers.c: (get_security_for_conf_string),
+       (modest_server_account_set_security): 
+       * src/modest-defs.h: Add comments explaining that our 
+       UI spec means TLS when it says Normal, so these do not look like errors.
+       
+       * src/modest-tny-account.c:
+       (modest_tny_account_new_from_server_account): Use the new tinymail 
+       'wrapped' option for regular SSL, and use the new tinymail 'tls' option 
+       for TLS. This should fix projects.maemo.org bug NB#58460.
+
 2007-06-06  Murray Cumming  <murrayc@murrayc.com>
 
        * src/maemo/easysetup/modest-easysetup-wizard.c:
index 5de9195..42eaa1d 100644 (file)
@@ -324,9 +324,10 @@ get_security_for_conf_string(const gchar* value)
        if (value) {
                if (strcmp(value, MODEST_ACCOUNT_SECURITY_VALUE_NONE) == 0)
                        result = MODEST_PROTOCOL_CONNECTION_NORMAL;
-               else if (strcmp(value, MODEST_ACCOUNT_SECURITY_VALUE_NORMAL) == 0)
+               else if (strcmp(value, MODEST_ACCOUNT_SECURITY_VALUE_NORMAL) == 0) {
+                       /* The UI has "Normal (TLS)": */
                        result = MODEST_PROTOCOL_CONNECTION_TLS;
-               else if (strcmp(value, MODEST_ACCOUNT_SECURITY_VALUE_SSL) == 0)
+               } else if (strcmp(value, MODEST_ACCOUNT_SECURITY_VALUE_SSL) == 0)
                        result = MODEST_PROTOCOL_CONNECTION_SSL;
        }
        
@@ -357,9 +358,10 @@ modest_server_account_set_security (ModestAccountMgr *self,
        const gchar* str_value = NULL;
        if (security == MODEST_PROTOCOL_CONNECTION_NORMAL)
                str_value = MODEST_ACCOUNT_SECURITY_VALUE_NONE;
-       else if (security == MODEST_PROTOCOL_CONNECTION_TLS)
+       else if (security == MODEST_PROTOCOL_CONNECTION_TLS) {
+               /* The UI has "Normal (TLS)": */
                str_value = MODEST_ACCOUNT_SECURITY_VALUE_NORMAL;
-       else if (security == MODEST_PROTOCOL_CONNECTION_SSL)
+       } else if (security == MODEST_PROTOCOL_CONNECTION_SSL)
                str_value = MODEST_ACCOUNT_SECURITY_VALUE_SSL;
        
        /* Set it in the configuration: */
index 2d91fc9..e3646be 100644 (file)
 
 #define MODEST_ACCOUNT_SECURITY "security"
 #define MODEST_ACCOUNT_SECURITY_VALUE_NONE "none"
-#define MODEST_ACCOUNT_SECURITY_VALUE_NORMAL "normal"
+#define MODEST_ACCOUNT_SECURITY_VALUE_NORMAL "normal" /* Meaning "Normal (TLS)", as in our UI spec. */ 
 #define MODEST_ACCOUNT_SECURITY_VALUE_SSL "ssl"
 
 /* Macros for different text formats in mail editor */
index 10e526d..5c76d04 100644 (file)
@@ -128,8 +128,14 @@ modest_tny_account_get_special_folder (TnyAccount *account,
  */
 #define MODEST_ACCOUNT_OPTION_SSL "use_ssl"
 #define MODEST_ACCOUNT_OPTION_SSL_NEVER "never"
-#define MODEST_ACCOUNT_OPTION_SSL_ALWAYS "always"
+/* This is a tinymail camel-lite specific option, 
+ * roughly equivalent to "always" in regular camel,
+ * which is appropriate for a generic "SSL" connection option: */
+#define MODEST_ACCOUNT_OPTION_SSL_WRAPPED "wrapped"
+/* Not used in our UI so far: */
 #define MODEST_ACCOUNT_OPTION_SSL_WHEN_POSSIBLE "when-possible"
+/* This is a tinymailcamel-lite specific option that is not in regular camel. */
+#define MODEST_ACCOUNT_OPTION_SSL_TLS "tls"
 
 /* These seem to be listed in 
  * libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-provider.c 
@@ -232,10 +238,15 @@ modest_tny_account_new_from_server_account (ModestAccountMgr *account_mgr,
                        option_security = MODEST_ACCOUNT_OPTION_SSL "=" MODEST_ACCOUNT_OPTION_SSL_NEVER;
                        break;
                case MODEST_PROTOCOL_CONNECTION_SSL:
+                       /* Apparently, use of "IMAPS" (specified in our UI spec), implies 
+                        * use of the "wrapped" option: */
+                       option_security = MODEST_ACCOUNT_OPTION_SSL "=" MODEST_ACCOUNT_OPTION_SSL_WRAPPED;
+                       break;
                case MODEST_PROTOCOL_CONNECTION_TLS:
-                       option_security = MODEST_ACCOUNT_OPTION_SSL "=" MODEST_ACCOUNT_OPTION_SSL_ALWAYS;;
+                       option_security = MODEST_ACCOUNT_OPTION_SSL "=" MODEST_ACCOUNT_OPTION_SSL_TLS;
                        break;
                case MODEST_PROTOCOL_CONNECTION_TLS_OP:
+                       /* This is not actually in our UI: */
                        option_security = MODEST_ACCOUNT_OPTION_SSL "=" MODEST_ACCOUNT_OPTION_SSL_WHEN_POSSIBLE;
                        break;
                default: