+2007-05-11 Murray Cumming <murrayc@murrayc.com>
+
+ * src/maemo/modest-main-window.c: (on_account_update):
+ Very slight cleanup, hoping to make it simpler to discover what causes
+ a crash here sometimes.
+
+ * src/modest-tny-account.c:
+ (modest_tny_account_new_from_server_account): Set the port. Added
+ comments about the options and a TODO comment because I need to find out
+ how to specify the secure authentication method.
+
2007-05-11 Marcus Bauer <marcusb@openismus.com>
* libmodest-dbus-client/libmodest-dbus-client-1.0.pc.in:
static void
on_account_update (TnyAccountStore *account_store,
- gchar *accout_name,
+ gchar *account_name,
gpointer user_data)
{
GSList *account_names, *iter, *accounts;
ModestMainWindowPrivate *priv;
ModestWindowPrivate *parent_priv;
ModestAccountMgr *mgr;
- gint i, num_accounts;
- ModestAccountData *account_data;
+ gint i, num_accounts;
GtkActionGroup *action_group;
GList *groups;
gchar *default_account;
accounts = NULL;
while (iter) {
- account_data = modest_account_mgr_get_account_data (mgr, (gchar*) iter->data);
+ ModestAccountData *account_data =
+ modest_account_mgr_get_account_data (mgr, (gchar*) iter->data);
accounts = g_slist_prepend (accounts, account_data);
iter = iter->next;
GtkAction *new_action = NULL;
gchar *display_name = NULL;
- account_data = (ModestAccountData *) g_slist_nth_data (accounts, i);
+ ModestAccountData *account_data = (ModestAccountData *) g_slist_nth_data (accounts, i);
/* Create display name. The default account is shown differently */
if (default_account && account_data->account_name &&
}
/* Camel options: */
+
+/* These seem to be listed in
+ * libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-store.c
+ */
#define MODEST_ACCOUNT_OPTION_SSL "use_ssl"
#define MODEST_ACCOUNT_OPTION_SSL_NEVER "never"
#define MODEST_ACCOUNT_OPTION_SSL_ALWAYS "always"
#define MODEST_ACCOUNT_OPTION_SSL_WHEN_POSSIBLE "when-possible"
-#define MODEST_ACCOUNT_OPTION_USE_LSUB "use_lsub"
-#define MODEST_ACCOUNT_OPTION_CHECK_ALL "check_all"
+
+/* These seem to be listed in
+ * libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-provider.c
+ */
+#define MODEST_ACCOUNT_OPTION_USE_LSUB "use_lsub" /* Show only subscribed folders */
+#define MODEST_ACCOUNT_OPTION_CHECK_ALL "check_all" /* Check for new messages in all folders */
+
+/* TODO: Find how to specify the authentication method with camel.
+ * This is just made up stuff - I have no idea if its even possible via options:
+#define MODEST_ACCOUNT_OPTION_AUTH "auth"
+#define MODEST_ACCOUNT_OPTION_AUTH_PLAIN "PLAIN"
+#define MODEST_ACCOUNT_OPTION_AUTH_PASSWORD "PASSWORD"
+#define MODEST_ACCOUNT_OPTION_AUTH_CRAMMD5 "CRAMMD5"
+*/
/**
* modest_tny_account_new_from_server_account:
/* Proto */
tny_account_set_proto (tny_account,
modest_protocol_info_get_protocol_name(account_data->proto));
+
if (account_data->uri)
tny_account_set_url_string (TNY_ACCOUNT(tny_account), account_data->uri);
else {
+ /* Set camel-specific options: */
+
+ /* To enable security settings: */
const gchar* option_security = NULL;
switch (account_data->security) {
case MODEST_PROTOCOL_SECURITY_NONE:
option_security);
}
+ /* To enable secure-auth settings: */
+ /* The UI spec says:
+ * # If secure authentication is unchecked, allow sending username and password also as plain text.
+ * # If secure authentication is checked, require one of the secure methods during connection: SSL, TLS, CRAM-MD5 etc
+ */
+ /* TODO: Find how to specify the authentication method with camel.
+ * This is just made up stuff - I have no idea if its even possible via options:
+ const gchar* option_secure_auth = NULL;
+ switch (account_data->secure_auth) {
+ case MODEST_PROTOCOL_AUTH_NONE:
+ option_secure_auth = MODEST_ACCOUNT_OPTION_AUTH "= " MODEST_ACCOUNT_OPTION_AUTH_PLAIN;
+ break;
+ case MODEST_PROTOCOL_AUTH_PASSWORD:
+ option_secure_auth = MODEST_ACCOUNT_OPTION_AUTH "= " MODEST_ACCOUNT_OPTION_AUTH_PASSWORD;
+ break;
+ case MODEST_PROTOCOL_AUTH_CRAMMD5:
+ option_secure_auth = MODEST_ACCOUNT_OPTION_AUTH "= " MODEST_ACCOUNT_OPTION_AUTH_CRAMMD5;
+ default:
+ break;
+ }
+
+ if(option_secure_auth) {
+ tny_camel_account_add_option (TNY_CAMEL_ACCOUNT (tny_account),
+ option_secure_auth);
+ }
+ */
+
if (account_data->proto == MODEST_PROTOCOL_TYPE_STORE) {
- /* Connection options. Some options are only valid for IMAP
+ /* Other connection options. Some options are only valid for IMAP
accounts but it's OK for just now since POP is still not
supported */
tny_camel_account_add_option (TNY_CAMEL_ACCOUNT (tny_account),
tny_account_set_user (tny_account, account_data->username);
if (account_data->hostname)
tny_account_set_hostname (tny_account, account_data->hostname);
+
+ /* Set the port: */
+ if (account_data->port)
+ tny_account_set_port (tny_account, account_data->port);
}
+
+
return tny_account;
}