aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers/imap/camel-imap-provider.c
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2001-03-22 06:20:29 +0800
committerDan Winship <danw@src.gnome.org>2001-03-22 06:20:29 +0800
commit5d562c3d3d879d05c75ecb300c53e0b5ae0120fc (patch)
tree6ca10894c653240c1be004faf130ffddf6511b9b /camel/providers/imap/camel-imap-provider.c
parent0ec6ccc4dfc136dd7347e49e4dc2b309126706a9 (diff)
downloadgsoc2013-evolution-5d562c3d3d879d05c75ecb300c53e0b5ae0120fc.tar
gsoc2013-evolution-5d562c3d3d879d05c75ecb300c53e0b5ae0120fc.tar.gz
gsoc2013-evolution-5d562c3d3d879d05c75ecb300c53e0b5ae0120fc.tar.bz2
gsoc2013-evolution-5d562c3d3d879d05c75ecb300c53e0b5ae0120fc.tar.lz
gsoc2013-evolution-5d562c3d3d879d05c75ecb300c53e0b5ae0120fc.tar.xz
gsoc2013-evolution-5d562c3d3d879d05c75ecb300c53e0b5ae0120fc.tar.zst
gsoc2013-evolution-5d562c3d3d879d05c75ecb300c53e0b5ae0120fc.zip
add a "GList *authtypes", so you can get the list of authtypes used by a
* camel-provider.h: (CamelProvider) add a "GList *authtypes", so you can get the list of authtypes used by a provider without needing to have an actual CamelService object handy. (Will be needed by the new config druid.) (CAMEL_PROVIDER_ALLOWS, CAMEL_PROVIDER_NEEDS): New macros to test the URL part stuff, since the way it works is too complicated and everyone always does it wrong. * camel-service.c (camel_service_query_auth_types): Remove the @connected arg again: if you don't want to connect, you can just get the list of authtypes off the provider. (camel_service_free_auth_types): Remove this. All existing implementations do authtypes the same way, so just say the caller should "g_list_free" the list. (Oh, look, removing this function doesn't actually cause the mailer to not build. How 'bout that.) (construct, get_path): Use the new URL part macros. * camel-remote-store.c (remote_query_auth_types): Update (remote_free_auth_types): Nuke (camel_remote_store_authtype_list): New function for use by subclasses. * providers/imap/camel-imap-provider.c: * providers/pop3/camel-pop3-provider.c: * providers/smtp/camel-smtp-provider.c: Update CamelProvider structures. (camel_provider_module_init): Put all the SSL parts together so there's only 1 #ifdef. Set up the provider authtypes field using the SASL, CamelRemoteStore, and standard authtypes, as appropriate. Copy that from the normal provider to the SSL provider. * providers/local/camel-local-provider.c: * providers/sendmail/camel-sendmail-provider.c: * camel-session.c: Update CamelProvider structures. * providers/imap/camel-imap-store.c (query_auth_types): * providers/pop3/camel-pop3-store.c (query_auth_types): Update * providers/smtp/camel-smtp-store.c (query_auth_types): Update. Remove the no_authtype, because that's what "ALLOW_AUTH" rather than "NEED_AUTH" means. (free_auth_types): Nuke. svn path=/trunk/; revision=8872
Diffstat (limited to 'camel/providers/imap/camel-imap-provider.c')
-rw-r--r--camel/providers/imap/camel-imap-provider.c37
1 files changed, 22 insertions, 15 deletions
diff --git a/camel/providers/imap/camel-imap-provider.c b/camel/providers/imap/camel-imap-provider.c
index ea41a2ece8..593231a56e 100644
--- a/camel/providers/imap/camel-imap-provider.c
+++ b/camel/providers/imap/camel-imap-provider.c
@@ -28,6 +28,7 @@
#include "camel-provider.h"
#include "camel-session.h"
#include "camel-url.h"
+#include "camel-sasl.h"
static void add_hash (guint *hash, char *s);
static guint imap_url_hash (gconstpointer key);
@@ -48,9 +49,7 @@ static CamelProvider imap_provider = {
CAMEL_URL_NEED_USER | CAMEL_URL_NEED_HOST |
CAMEL_URL_ALLOW_PATH | CAMEL_URL_ALLOW_AUTH,
- { 0, 0 },
-
- NULL
+ /* ... */
};
#if defined (HAVE_NSS) || defined (HAVE_OPENSSL)
@@ -68,30 +67,38 @@ static CamelProvider simap_provider = {
CAMEL_URL_NEED_USER | CAMEL_URL_NEED_HOST |
CAMEL_URL_ALLOW_PATH | CAMEL_URL_ALLOW_AUTH,
- { 0, 0 },
-
- NULL
+ /* ... */
};
#endif /* HAVE_NSS or HAVE_OPENSSL */
+CamelServiceAuthType camel_imap_password_authtype = {
+ N_("Password"),
+
+ N_("This option will connect to the IMAP server using a "
+ "plaintext password."),
+
+ "",
+ TRUE
+};
+
void
camel_provider_module_init (CamelSession *session)
{
imap_provider.object_types[CAMEL_PROVIDER_STORE] =
camel_imap_store_get_type ();
+ imap_provider.service_cache = g_hash_table_new (imap_url_hash, imap_url_equal);
+ imap_provider.authtypes = g_list_concat (camel_remote_store_authtype_list (),
+ camel_sasl_authtype_list ());
+ imap_provider.authtypes = g_list_prepend (imap_provider.authtypes,
+ &camel_imap_password_authtype);
+
+ camel_session_register_provider (session, &imap_provider);
+
#if defined (HAVE_NSS) || defined (HAVE_OPENSSL)
simap_provider.object_types[CAMEL_PROVIDER_STORE] =
camel_imap_store_get_type ();
-#endif
-
- imap_provider.service_cache = g_hash_table_new (imap_url_hash, imap_url_equal);
-
-#if defined (HAVE_NSS) || defined (HAVE_OPENSSL)
simap_provider.service_cache = g_hash_table_new (imap_url_hash, imap_url_equal);
-#endif
-
- camel_session_register_provider (session, &imap_provider);
-#if defined (HAVE_NSS) || defined (HAVE_OPENSSL)
+ simap_provider.authtypes = g_list_copy (imap_provider.authtypes);
camel_session_register_provider (session, &simap_provider);
#endif
}