[evolution-kolab/ek-wip-porting] CamelKolabIMAPXProvider: updated for upstream (3.3.3) IMAPX provider



commit 36452862d66e3968194738592c623382aef48664
Author: Christian Hilberg <hilberg kernelconcepts de>
Date:   Tue Jan 10 12:46:11 2012 +0100

    CamelKolabIMAPXProvider: updated for upstream (3.3.3) IMAPX provider
    
    * updated the provider configuration and descriptive
      structures to upstream IMAPX
    * translatable strings are now mostly the same as
      for upstream IMAPX (with minor changes for Kolab)
    * all configuration options which can be set for IMAPX
      are also available in Kolab2 (default for junk filtering
      in Kolab2 is "off", while in IMAPX it is "on")

 src/camel/camel-kolab-imapx-provider.c |  108 +++++++++++++++++--------------
 1 files changed, 59 insertions(+), 49 deletions(-)
---
diff --git a/src/camel/camel-kolab-imapx-provider.c b/src/camel/camel-kolab-imapx-provider.c
index a68d24f..6fe9cf9 100644
--- a/src/camel/camel-kolab-imapx-provider.c
+++ b/src/camel/camel-kolab-imapx-provider.c
@@ -48,58 +48,80 @@
 
 /*----------------------------------------------------------------------------*/
 
-/* TODO customize for kolab2 */
-CamelProviderConfEntry kolab_imapx_conf_entries[] = {
+CamelProviderConfEntry kolab_conf_entries[] = {
 	{ CAMEL_PROVIDER_CONF_SECTION_START, "mailcheck", NULL,
 	  N_("Checking for New Mail") },
-	{ CAMEL_PROVIDER_CONF_CHECKBOX, "use_idle", NULL,
-	  N_("Use I_dle if the server supports it"), "1" },
-	{ CAMEL_PROVIDER_CONF_CHECKBOX, "check_all", NULL,
+	{ CAMEL_PROVIDER_CONF_CHECKBOX, "check-all", NULL,
 	  N_("C_heck for new messages in all folders"), "1" },
-	{ CAMEL_PROVIDER_CONF_CHECKBOX, "check_lsub", NULL,
+	{ CAMEL_PROVIDER_CONF_CHECKBOX, "check-subscribed", NULL,
 	  N_("Ch_eck for new messages in subscribed folders"), "0" },
+	{ CAMEL_PROVIDER_CONF_CHECKBOX, "use-qresync", NULL,
+	  N_("Use _Quick Resync if the server supports it"), "1" },
+	{ CAMEL_PROVIDER_CONF_CHECKBOX, "use-idle", NULL,
+	  N_("_Listen for server change notifications"), "1" },
 	{ CAMEL_PROVIDER_CONF_SECTION_END },
+#ifndef G_OS_WIN32
+	{ CAMEL_PROVIDER_CONF_SECTION_START, "cmdsection", NULL,
+	  N_("Connection to Server") },
+	{ CAMEL_PROVIDER_CONF_CHECKBOX, "use-shell-command", NULL,
+	  N_("_Use custom command to connect to server"), "0" },
+	{ CAMEL_PROVIDER_CONF_ENTRY, "shell-command", "use-shell-command",
+	  N_("Command:"), "ssh -C -l %u %h exec /usr/sbin/dovecot --exec-mail imap" },
+	{ CAMEL_PROVIDER_CONF_CHECKSPIN, "concurrent-connections", NULL,
+	  N_("Numbe_r of cached connections to use"), "y:1:5:7" },
+	{ CAMEL_PROVIDER_CONF_SECTION_END },
+#endif
 	{ CAMEL_PROVIDER_CONF_SECTION_START, "folders", NULL,
 	  N_("Folders") },
-	{ CAMEL_PROVIDER_CONF_CHECKBOX, "use_lsub", NULL,
+	{ CAMEL_PROVIDER_CONF_CHECKBOX, "use-subscriptions", NULL,
 	  N_("_Show only subscribed folders"), "1" },
 	{ CAMEL_PROVIDER_CONF_SECTION_END },
 	{ CAMEL_PROVIDER_CONF_SECTION_START, "general", NULL, N_("Options") },
-	{ CAMEL_PROVIDER_CONF_CHECKBOX, "filter", NULL,
-	  N_("_Apply filters to new messages in INBOX on this server"), "0" },
-	{ CAMEL_PROVIDER_CONF_CHECKBOX, "filter_junk", NULL,
+	{ CAMEL_PROVIDER_CONF_CHECKBOX, "filter-inbox", NULL,
+	  N_("_Apply filters to new messages in Inbox on this server"), "0" },
+	{ CAMEL_PROVIDER_CONF_CHECKBOX, "filter-junk", NULL,
 	  N_("Check new messages for Jun_k contents"), "0" },
-	{ CAMEL_PROVIDER_CONF_CHECKBOX, "filter_junk_inbox", "filter_junk",
+	{ CAMEL_PROVIDER_CONF_CHECKBOX, "filter-junk-inbox", "filter-junk",
 	  N_("Only check for Junk messages in the IN_BOX folder"), "0" },
-	{ CAMEL_PROVIDER_CONF_CHECKBOX, "sync_offline", NULL,
+	{ CAMEL_PROVIDER_CONF_CHECKBOX, "stay-synchronized", NULL,
 	  N_("Automatically synchroni_ze remote mail locally"), "0" },
 	{ CAMEL_PROVIDER_CONF_SECTION_END },
 	{ CAMEL_PROVIDER_CONF_END }
 };
 
-static CamelProvider kolab_imapx_provider = {	/* http://www.go-evolution.org/Camel.Provider */
+CamelProviderPortEntry kolab_port_entries[] = {
+	{ 143, N_("Default IMAP port"), FALSE },
+	{ 993, N_("IMAP over SSL"), TRUE },
+	{ 0, NULL, 0 }
+};
+
+static CamelProvider kolab_provider = {
 	KOLAB_CAMEL_PROVIDER_PROTOCOL,
 
-	N_(KOLAB_CAMEL_PROVIDER_NAME),
+	N_("Kolab2"),
+
+	N_("For reading and storing mail on Kolab servers."),
 
-	N_("For accessing Kolab2 servers."),
 	"mail",
 
-	/* TODO customize for kolab2 */
-	CAMEL_PROVIDER_IS_REMOTE | CAMEL_PROVIDER_IS_SOURCE | \
+	CAMEL_PROVIDER_IS_REMOTE | CAMEL_PROVIDER_IS_SOURCE |
 	CAMEL_PROVIDER_IS_STORAGE | CAMEL_PROVIDER_SUPPORTS_SSL,
 
-	/* TODO customize for kolab2 */
-	CAMEL_URL_NEED_USER | CAMEL_URL_NEED_HOST | CAMEL_URL_NEED_AUTH,
+	CAMEL_URL_NEED_USER | CAMEL_URL_NEED_HOST | CAMEL_URL_ALLOW_AUTH,
 
-	kolab_imapx_conf_entries,
+	kolab_conf_entries,
+
+	kolab_port_entries,
 
 	/* ... */
 };
 
-static CamelServiceAuthType kolab_imapx_password_authtype = {
+CamelServiceAuthType kolab_password_authtype = {
 	N_("Password"),
-	N_("This option will connect to the Kolab2 server using a plaintext password."),
+
+	N_("This option will connect to the Kolab server using a "
+	   "plaintext password."),
+
 	"",
 	TRUE
 };
@@ -120,39 +142,27 @@ extern void camel_imapx_module_init (void);
 void
 camel_kolab_imapx_provider_module_init (void)
 {
-	camel_imapx_module_init ();
-
-	kolab_imapx_provider.object_types[CAMEL_PROVIDER_STORE] = camel_kolab_imapx_store_get_type ();
-	kolab_imapx_provider.object_types[CAMEL_PROVIDER_TRANSPORT] = G_TYPE_INVALID;
-	kolab_imapx_provider.url_hash = kolab_url_hash;
-	kolab_imapx_provider.url_equal = kolab_url_equal;
-	kolab_imapx_provider.authtypes = camel_sasl_authtype_list(FALSE);
-	kolab_imapx_provider.authtypes = g_list_prepend (kolab_imapx_provider.authtypes,
-	                                                 &kolab_imapx_password_authtype);
-	kolab_imapx_provider.translation_domain = GETTEXT_PACKAGE;
-
-	/* TODO
-	 * bindtextdomain (GETTEXT_PACKAGE, KOLAB_LOCALEDIR);
-	 * bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
-	 */
-	g_assert (kolab_imapx_provider.object_types[CAMEL_PROVIDER_STORE] != G_TYPE_INVALID);
+	camel_imapx_module_init (); /* init parent module */
+
+	kolab_provider.object_types[CAMEL_PROVIDER_STORE] = camel_kolab_imapx_store_get_type ();
+	kolab_provider.object_types[CAMEL_PROVIDER_TRANSPORT] = G_TYPE_INVALID;
+	kolab_provider.url_hash = kolab_url_hash;
+	kolab_provider.url_equal = kolab_url_equal;
+	kolab_provider.authtypes = camel_sasl_authtype_list (FALSE);
+	kolab_provider.authtypes = g_list_prepend (kolab_provider.authtypes,
+	                                           &kolab_password_authtype);
+	kolab_provider.translation_domain = GETTEXT_PACKAGE;
+
+	g_assert (kolab_provider.object_types[CAMEL_PROVIDER_STORE] != G_TYPE_INVALID);
 	g_debug ("%s: done", __func__);
 }
 
 void
 camel_provider_module_init (void)
 {
+	g_assert (kolab_provider.object_types[CAMEL_PROVIDER_STORE] != G_TYPE_INVALID);
 	camel_kolab_imapx_provider_module_init ();
-
-	/* TODO
-	 * maybe we need to call the following from within
-	 * kolab_camel_provider_module_init ()
-	 * (might be needed if the provider plugin system
-	 * needs to be initialized from within the backends
-	 * as well)
-	 */
-	g_assert (kolab_imapx_provider.object_types[CAMEL_PROVIDER_STORE] != G_TYPE_INVALID);
-	camel_provider_register (&kolab_imapx_provider);
+	camel_provider_register (&kolab_provider);
 	g_debug ("%s: %s provider registered",
 	         __func__, KOLAB_CAMEL_PROVIDER_PROTOCOL);
 }
@@ -169,7 +179,7 @@ kolab_add_hash (guint *hash, char *s)
 static guint
 kolab_url_hash (gconstpointer key)
 {
-	const CamelURL	*u = (CamelURL *)key;
+	const CamelURL *u = (CamelURL *)key;
 	guint hash = 0;
 
 	kolab_add_hash (&hash, u->user);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]