r1559 - in /experimental/evolution-data-server/debian: ./ patches/

corsac at users.alioth.debian.org corsac at users.alioth.debian.org
Thu Mar 11 07:55:33 UTC 2010


Author: corsac
Date: Thu Mar 11 07:55:31 2010
New Revision: 1559

URL: http://svn.debian.org/wsvn/pkg-evolution/?sc=1&rev=1559
Log:
add new round of patches for imapx

Added:
    experimental/evolution-data-server/debian/patches/107-Fix-a-crash-during-offline-message-sync.patch
    experimental/evolution-data-server/debian/patches/108-Bug-612121-IMAPX-No-UTF7-folder-name-encoding-applie.patch
    experimental/evolution-data-server/debian/patches/109-Bug-612260-imapx-Moving-a-message-to-other-folder-ma.patch
    experimental/evolution-data-server/debian/patches/110-delete-folders-while-syncronizing.patch
    experimental/evolution-data-server/debian/patches/111-fix-a-error-from-previous-commit-for-bug-612121.patch
    experimental/evolution-data-server/debian/patches/112-Bug-612116-IMAPX-Problems-with-separator-.-and-names.patch
    experimental/evolution-data-server/debian/patches/113-Implement-folder-subscriptions-imapx.patch
    experimental/evolution-data-server/debian/patches/114-Ensure-inbox-is-subscribed-if-lsub-is-used-during-in.patch
    experimental/evolution-data-server/debian/patches/115-implement-create-folder-imapx.patch
    experimental/evolution-data-server/debian/patches/116-Bug-604047-Use-accessor-functions-instead-of-direct-.patch
    experimental/evolution-data-server/debian/patches/117-Implement-folder_delete-imapx.patch
    experimental/evolution-data-server/debian/patches/118-Bug-612401-IMAPX-cann-t-create-folder-in-top-hierarc.patch
    experimental/evolution-data-server/debian/patches/119-Sync-changes-before-expunge.patch
    experimental/evolution-data-server/debian/patches/120-Strip-whitespace-off-strings-returned-from-e_contact.patch
Removed:
    experimental/evolution-data-server/debian/patches/66_fix-utf7-encoding-imapx.patch
    experimental/evolution-data-server/debian/patches/67_fix-move-message-marked-as-unread.patch
    experimental/evolution-data-server/debian/patches/68_delete-folders-while-sync.patch
    experimental/evolution-data-server/debian/patches/69_really-fix-utf7-encoded-folders.patch
    experimental/evolution-data-server/debian/patches/70_fix-namespace-separator.patch
    experimental/evolution-data-server/debian/patches/71_imapx-folder-subscription.patch
    experimental/evolution-data-server/debian/patches/72_imapx-inbox-subscription.patch
Modified:
    experimental/evolution-data-server/debian/changelog

Modified: experimental/evolution-data-server/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-evolution/experimental/evolution-data-server/debian/changelog?rev=1559&op=diff
==============================================================================
--- experimental/evolution-data-server/debian/changelog (original)
+++ experimental/evolution-data-server/debian/changelog Thu Mar 11 07:55:31 2010
@@ -1,12 +1,23 @@
 evolution-data-server (2.29.92-2) UNRELEASED; urgency=low
 
   * debian/patches
-    - 66_fix-utf7-encoding-imapx, 68_delete-folders-while-sync,
-      69_really-fix-utf7-encoded-folders, 67_fix-move-message-marked-as-unread,
-      70_fix-namespace-separator, 72_imapx-inbox-subscription,
-      71_imapx-folder-subscription added, fixes for IMAP+ backend.
-
- -- Yves-Alexis Perez <corsac at debian.org>  Tue, 09 Mar 2010 20:05:11 +0100
+    115-implement-create-folder-imapx,
+      111-fix-a-error-from-previous-commit-for-bug-612121,
+      113-Implement-folder-subscriptions-imapx,
+      110-delete-folders-while-syncronizing,
+      109-Bug-612260-imapx-Moving-a-message-to-other-folder-ma,
+      116-Bug-604047-Use-accessor-functions-instead-of-direct-,
+      118-Bug-612401-IMAPX-cann-t-create-folder-in-top-hierarc,
+      119-Sync-changes-before-expunge, 117-Implement-folder_delete-imapx,
+      108-Bug-612121-IMAPX-No-UTF7-folder-name-encoding-applie,
+      107-Fix-a-crash-during-offline-message-sync,
+      112-Bug-612116-IMAPX-Problems-with-separator-.-and-names,
+      114-Ensure-inbox-is-subscribed-if-lsub-is-used-during-in,
+      120-Strip-whitespace-off-strings-returned-from-e_contact added, a bunch
+    of patches for IMAP+ (imapx) backend.
+
+
+ -- Yves-Alexis Perez <corsac at debian.org>  Thu, 11 Mar 2010 08:52:56 +0100
 
 evolution-data-server (2.29.92-1) experimental; urgency=low
 

Added: experimental/evolution-data-server/debian/patches/107-Fix-a-crash-during-offline-message-sync.patch
URL: http://svn.debian.org/wsvn/pkg-evolution/experimental/evolution-data-server/debian/patches/107-Fix-a-crash-during-offline-message-sync.patch?rev=1559&op=file
==============================================================================
--- experimental/evolution-data-server/debian/patches/107-Fix-a-crash-during-offline-message-sync.patch (added)
+++ experimental/evolution-data-server/debian/patches/107-Fix-a-crash-during-offline-message-sync.patch Thu Mar 11 07:55:31 2010
@@ -1,0 +1,47 @@
+From f7ba2530e30848760dcfc8ec6c04bc9bb19799e4 Mon Sep 17 00:00:00 2001
+From: Chenthill Palanisamy <pchenthill at novell.com>
+Date: Mon, 8 Mar 2010 11:56:23 +0530
+Subject: [PATCH 07/21] Fix a crash during offline-message sync.
+
+---
+ camel/providers/imapx/camel-imapx-server.c |   12 ++++++++++--
+ 1 files changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/camel/providers/imapx/camel-imapx-server.c b/camel/providers/imapx/camel-imapx-server.c
+index 4dc9e2a..8d666c4 100644
+--- a/camel/providers/imapx/camel-imapx-server.c
++++ b/camel/providers/imapx/camel-imapx-server.c
+@@ -3663,12 +3663,21 @@ imapx_server_get_message (CamelIMAPXServer *is, CamelFolder *folder, CamelOperat
+ 	QUEUE_LOCK (is);
+ 
+ 	if (imapx_is_job_in_queue (is, folder->full_name, IMAPX_JOB_GET_MESSAGE, uid)) {
+-		/* TODO set a right exception */
+ 		camel_exception_set (ex, CAMEL_EXCEPTION_OPERATION_IN_PROGRESS, "Downloading message...");
+ 		QUEUE_UNLOCK (is);
+ 		return NULL;
+ 	}
+ 
++	mi = camel_folder_summary_uid (folder->summary, uid);
++	if (!mi) {
++		camel_exception_setv (
++				ex, CAMEL_EXCEPTION_FOLDER_INVALID_UID,
++				_("Cannot get message with message ID %s: %s"),
++				uid, _("No such message available."));
++		QUEUE_UNLOCK (is);
++		return NULL;
++	}
++
+ 	tmp_stream = camel_data_cache_add (ifolder->cache, "tmp", uid, NULL);
+ 
+ 	job = g_malloc0(sizeof(*job));
+@@ -3681,7 +3690,6 @@ imapx_server_get_message (CamelIMAPXServer *is, CamelFolder *folder, CamelOperat
+ 	job->u.get_message.stream = tmp_stream;
+ 	job->ex = ex;
+ 
+-	mi = camel_folder_summary_uid (folder->summary, uid);
+ 	if (((CamelMessageInfoBase *) mi)->size > MULTI_SIZE)
+ 		job->u.get_message.use_multi_fetch = TRUE;
+ 
+-- 
+1.7.0
+

Added: experimental/evolution-data-server/debian/patches/108-Bug-612121-IMAPX-No-UTF7-folder-name-encoding-applie.patch
URL: http://svn.debian.org/wsvn/pkg-evolution/experimental/evolution-data-server/debian/patches/108-Bug-612121-IMAPX-No-UTF7-folder-name-encoding-applie.patch?rev=1559&op=file
==============================================================================
--- experimental/evolution-data-server/debian/patches/108-Bug-612121-IMAPX-No-UTF7-folder-name-encoding-applie.patch (added)
+++ experimental/evolution-data-server/debian/patches/108-Bug-612121-IMAPX-No-UTF7-folder-name-encoding-applie.patch Thu Mar 11 07:55:31 2010
@@ -1,0 +1,65 @@
+From cf137de9d0b5298f2d01a7129dea40e5721fd8d1 Mon Sep 17 00:00:00 2001
+From: Chenthill Palanisamy <pchenthill at novell.com>
+Date: Tue, 9 Mar 2010 12:37:30 +0530
+Subject: [PATCH 08/21] Bug 612121 - IMAPX: No UTF7 folder name encoding applied
+
+---
+ camel/providers/imapx/camel-imapx-server.c |   13 +++++++++++--
+ camel/providers/imapx/camel-imapx-utils.c  |    2 +-
+ 2 files changed, 12 insertions(+), 3 deletions(-)
+
+diff --git a/camel/providers/imapx/camel-imapx-server.c b/camel/providers/imapx/camel-imapx-server.c
+index 8d666c4..2d5d6f4 100644
+--- a/camel/providers/imapx/camel-imapx-server.c
++++ b/camel/providers/imapx/camel-imapx-server.c
+@@ -38,6 +38,7 @@
+ 
+ #include <camel/camel-sasl.h>
+ #include <camel/camel-i18n.h>
++#include <camel/camel-utf8.h>
+ #include <camel/camel-file-utils.h>
+ 
+ #include "camel-imapx-utils.h"
+@@ -490,6 +491,7 @@ imapx_command_addv(CamelIMAPXCommand *ic, const gchar *fmt, va_list ap)
+ 	CamelDataWrapper *D;
+ 	CamelSasl *A;
+ 	gchar buffer[16];
++	gchar *fname = NULL, *encoded = NULL;
+ 	CamelException ex = CAMEL_EXCEPTION_INITIALISER;
+ 
+ 	c(printf("adding command, fmt = '%s'\n", fmt));
+@@ -592,9 +594,16 @@ imapx_command_addv(CamelIMAPXCommand *ic, const gchar *fmt, va_list ap)
+ 				case 'f': /* imap folder name */
+ 					s = va_arg(ap, gchar *);
+ 					c(printf("got folder '%s'\n", s));
+-					/* FIXME: encode folder name */
+-					/* FIXME: namespace? */
++					fname = camel_imapx_store_summary_full_from_path(((CamelIMAPXStore *)ic->job->folder->parent_store)->summary, s);
++					if (fname) {
++						encoded = camel_utf8_utf7(fname);
++						g_free (fname);
++					} else
++						encoded = camel_utf8_utf7 (s);
++
+ 					camel_stream_printf((CamelStream *)ic->mem, "\"%s\"", s?s:"");
++
++					g_free (encoded);
+ 					break;
+ 				case 'F': /* IMAP flags set */
+ 					f = va_arg(ap, guint32);
+diff --git a/camel/providers/imapx/camel-imapx-utils.c b/camel/providers/imapx/camel-imapx-utils.c
+index 3f561db..d93c0b3 100644
+--- a/camel/providers/imapx/camel-imapx-utils.c
++++ b/camel/providers/imapx/camel-imapx-utils.c
+@@ -1738,7 +1738,7 @@ imapx_parse_list(CamelIMAPXStream *is, CamelException *ex)
+ 	camel_imapx_stream_nstring(is, &token, ex);
+ 	linfo->separator = token?*token:0;
+ 	camel_imapx_stream_astring(is, &token, ex);
+-	linfo->name = g_strdup((gchar *) token);
++	linfo->name = camel_utf7_utf8 ((gchar *) token);
+ 
+ 	return linfo;
+ }
+-- 
+1.7.0
+

Added: experimental/evolution-data-server/debian/patches/109-Bug-612260-imapx-Moving-a-message-to-other-folder-ma.patch
URL: http://svn.debian.org/wsvn/pkg-evolution/experimental/evolution-data-server/debian/patches/109-Bug-612260-imapx-Moving-a-message-to-other-folder-ma.patch?rev=1559&op=file
==============================================================================
--- experimental/evolution-data-server/debian/patches/109-Bug-612260-imapx-Moving-a-message-to-other-folder-ma.patch (added)
+++ experimental/evolution-data-server/debian/patches/109-Bug-612260-imapx-Moving-a-message-to-other-folder-ma.patch Thu Mar 11 07:55:31 2010
@@ -1,0 +1,35 @@
+From 41f4d710b3daff0b5730d23f5fc27c2df89e4b18 Mon Sep 17 00:00:00 2001
+From: Chenthill Palanisamy <pchenthill at novell.com>
+Date: Tue, 9 Mar 2010 12:52:07 +0530
+Subject: [PATCH 09/21] Bug 612260 - [imapx] Moving a message to other folder marks it as unread
+
+---
+ camel/providers/imapx/camel-imapx-server.c |    5 +++++
+ 1 files changed, 5 insertions(+), 0 deletions(-)
+
+diff --git a/camel/providers/imapx/camel-imapx-server.c b/camel/providers/imapx/camel-imapx-server.c
+index 2d5d6f4..ac5c39b 100644
+--- a/camel/providers/imapx/camel-imapx-server.c
++++ b/camel/providers/imapx/camel-imapx-server.c
+@@ -2490,6 +2490,10 @@ cleanup:
+ static void
+ imapx_job_copy_messages_start (CamelIMAPXServer *is, CamelIMAPXJob *job)
+ {
++	camel_imapx_server_sync_changes (is, job->folder, job->ex);
++	if (camel_exception_is_set (job->ex))
++		imapx_job_done (is, job);
++
+ 	g_ptr_array_sort (job->u.copy_messages.uids, (GCompareFunc) imapx_uids_array_cmp);
+ 	imapx_uidset_init(&job->u.copy_messages.uidset, 0, MAX_COMMAND_LEN);
+ 	imapx_command_copy_messages_step_start (is, job, 0);
+@@ -3762,6 +3766,7 @@ camel_imapx_server_copy_message (CamelIMAPXServer *is, CamelFolder *source, Came
+ 	job->u.copy_messages.dest = dest;
+ 	job->u.copy_messages.uids = uids;
+ 	job->u.copy_messages.delete_originals = delete_originals;
++	job->ex = ex;
+ 
+ 	camel_object_ref(source);
+ 	camel_object_ref (dest);
+-- 
+1.7.0
+

Added: experimental/evolution-data-server/debian/patches/110-delete-folders-while-syncronizing.patch
URL: http://svn.debian.org/wsvn/pkg-evolution/experimental/evolution-data-server/debian/patches/110-delete-folders-while-syncronizing.patch?rev=1559&op=file
==============================================================================
--- experimental/evolution-data-server/debian/patches/110-delete-folders-while-syncronizing.patch (added)
+++ experimental/evolution-data-server/debian/patches/110-delete-folders-while-syncronizing.patch Thu Mar 11 07:55:31 2010
@@ -1,0 +1,135 @@
+From 16cb2c60ff0f1d0cecf8ceb8ecf6a8f802d7f5e6 Mon Sep 17 00:00:00 2001
+From: Chenthill Palanisamy <pchenthill at novell.com>
+Date: Tue, 9 Mar 2010 14:10:08 +0530
+Subject: [PATCH 10/21] delete folders while syncronizing
+
+---
+ camel/providers/imapx/camel-imapx-server.c |    1 +
+ camel/providers/imapx/camel-imapx-store.c  |   78 ++++++++++++++++++++++++++-
+ 2 files changed, 76 insertions(+), 3 deletions(-)
+
+diff --git a/camel/providers/imapx/camel-imapx-server.c b/camel/providers/imapx/camel-imapx-server.c
+index ac5c39b..1cdddd5 100644
+--- a/camel/providers/imapx/camel-imapx-server.c
++++ b/camel/providers/imapx/camel-imapx-server.c
+@@ -2285,6 +2285,7 @@ retry:
+ 		ns->sep = '/';
+ 		nsl->personal = ns;
+ 		imapx_store->summary->namespaces = nsl;
++		imapx_store->dir_sep = ns->sep;
+ 	}
+ 
+ 	if (!camel_exception_is_set (ex))
+diff --git a/camel/providers/imapx/camel-imapx-store.c b/camel/providers/imapx/camel-imapx-store.c
+index 0e21303..397c155 100644
+--- a/camel/providers/imapx/camel-imapx-store.c
++++ b/camel/providers/imapx/camel-imapx-store.c
+@@ -38,6 +38,7 @@
+ #include <string.h>
+ #include <unistd.h>
+ #include <errno.h>
++#include <glib/gstdio.h>
+ 
+ #include "camel/camel-operation.h"
+ 
+@@ -49,6 +50,7 @@
+ #include "camel/camel-data-cache.h"
+ #include "camel/camel-tcp-stream.h"
+ #include "camel/camel-tcp-stream-raw.h"
++#include "camel/camel-db.h"
+ #ifdef HAVE_SSL
+ #include "camel/camel-tcp-stream-ssl.h"
+ #endif
+@@ -446,6 +448,76 @@ imapx_match_pattern(CamelIMAPXStoreNamespace *ns, const gchar *pattern, const gc
+ 	return n == 0 && (p == '%' || p == 0);
+ }
+ 
++static void
++imapx_folder_unsubscribe_from_cache (CamelIMAPXStore *istore,
++				     const gchar *folder_name, CamelException *ex)
++{
++	CamelFolderInfo *fi;
++	CamelStoreInfo *si;
++
++	si = camel_store_summary_path((CamelStoreSummary *)istore->summary, folder_name);
++	if (si) {
++		if (si->flags & CAMEL_STORE_INFO_FOLDER_SUBSCRIBED) {
++			si->flags &= ~CAMEL_STORE_INFO_FOLDER_SUBSCRIBED;
++			camel_store_summary_touch((CamelStoreSummary *)istore->summary);
++			camel_store_summary_save((CamelStoreSummary *)istore->summary);
++		}
++		camel_store_summary_info_free((CamelStoreSummary *)istore->summary, si);
++	}
++
++	/* handle rename */
++
++	fi = imapx_build_folder_info(istore, folder_name);
++	camel_object_trigger_event (CAMEL_OBJECT (istore), "folder_unsubscribed", fi);
++	camel_folder_info_free (fi);
++}
++
++static void
++imapx_delete_folder_from_cache (CamelIMAPXStore *istore, const gchar *folder_name, CamelException *ex)
++{
++	gchar *state_file;
++	gchar *folder_dir, *storage_path;
++	CamelFolderInfo *fi;
++	const gchar *name = NULL;
++
++	name = strrchr (folder_name, istore->dir_sep);
++	if (name)
++		name++;
++	else
++		name = folder_name;
++
++	storage_path = g_strdup_printf ("%s/folders", istore->storage_path);
++	folder_dir = imapx_path_to_physical (storage_path, folder_name);
++	g_free (storage_path);
++	if (g_access (folder_dir, F_OK) != 0) {
++		g_free (folder_dir);
++		goto event;
++	}
++
++	/* Delete summary and all the data */
++	state_file = g_strdup_printf ("%s/cmeta", folder_dir);
++	g_unlink (state_file);
++	g_free (state_file);
++
++	camel_db_delete_folder (((CamelStore *)istore)->cdb_w, folder_name, ex);
++	g_rmdir (folder_dir);
++
++	state_file = g_strdup_printf("%s/subfolders", folder_dir);
++	g_rmdir(state_file);
++	g_free(state_file);
++
++	g_rmdir (folder_dir);
++	g_free (folder_dir);
++
++ event:
++	camel_store_summary_remove_path((CamelStoreSummary *)istore->summary, folder_name);
++	camel_store_summary_save((CamelStoreSummary *)istore->summary);
++
++	fi = imapx_build_folder_info(istore, folder_name);
++	camel_object_trigger_event (CAMEL_OBJECT (istore), "folder_deleted", fi);
++	camel_folder_info_free (fi);
++}
++
+ static CamelFolderInfo *
+ get_folder_info_offline (CamelStore *store, const gchar *top,
+ 			 guint32 flags, CamelException *ex)
+@@ -765,9 +837,9 @@ sync_folders (CamelIMAPXStore *istore, const gchar *pattern, CamelException *ex)
+ 					CamelException eex;
+ 
+ 					camel_exception_init (&eex);
+-
+-					/* Delete the folder from cache */
+-
++					imapx_folder_unsubscribe_from_cache (istore,dup_folder_name, &eex);
++					imapx_delete_folder_from_cache (istore, dup_folder_name, &eex);
++					
+ 					g_free (dup_folder_name);
+ 					camel_exception_clear (&eex);
+ 				} else {
+-- 
+1.7.0
+

Added: experimental/evolution-data-server/debian/patches/111-fix-a-error-from-previous-commit-for-bug-612121.patch
URL: http://svn.debian.org/wsvn/pkg-evolution/experimental/evolution-data-server/debian/patches/111-fix-a-error-from-previous-commit-for-bug-612121.patch?rev=1559&op=file
==============================================================================
--- experimental/evolution-data-server/debian/patches/111-fix-a-error-from-previous-commit-for-bug-612121.patch (added)
+++ experimental/evolution-data-server/debian/patches/111-fix-a-error-from-previous-commit-for-bug-612121.patch Thu Mar 11 07:55:31 2010
@@ -1,0 +1,37 @@
+From 433544fd66f0b774a2f42cff2ae229d3b534aab6 Mon Sep 17 00:00:00 2001
+From: Chenthill Palanisamy <pchenthill at novell.com>
+Date: Tue, 9 Mar 2010 14:15:22 +0530
+Subject: [PATCH 11/21] fix a error from previous commit for bug 612121
+
+---
+ camel/providers/imapx/camel-imapx-server.c |    4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/camel/providers/imapx/camel-imapx-server.c b/camel/providers/imapx/camel-imapx-server.c
+index 1cdddd5..c1f48c8 100644
+--- a/camel/providers/imapx/camel-imapx-server.c
++++ b/camel/providers/imapx/camel-imapx-server.c
+@@ -601,7 +601,7 @@ imapx_command_addv(CamelIMAPXCommand *ic, const gchar *fmt, va_list ap)
+ 					} else
+ 						encoded = camel_utf8_utf7 (s);
+ 
+-					camel_stream_printf((CamelStream *)ic->mem, "\"%s\"", s?s:"");
++					camel_stream_printf((CamelStream *)ic->mem, "\"%s\"", encoded?encoded:"");
+ 
+ 					g_free (encoded);
+ 					break;
+@@ -2281,10 +2281,10 @@ retry:
+ 		ns->next = NULL;
+ 		ns->path = g_strdup ("");
+ 		ns->full_name = g_strdup ("");
+-		/* FIXME needs to be identified from list response */
+ 		ns->sep = '/';
+ 		nsl->personal = ns;
+ 		imapx_store->summary->namespaces = nsl;
++		/* FIXME needs to be identified from list response */
+ 		imapx_store->dir_sep = ns->sep;
+ 	}
+ 
+-- 
+1.7.0
+

Added: experimental/evolution-data-server/debian/patches/112-Bug-612116-IMAPX-Problems-with-separator-.-and-names.patch
URL: http://svn.debian.org/wsvn/pkg-evolution/experimental/evolution-data-server/debian/patches/112-Bug-612116-IMAPX-Problems-with-separator-.-and-names.patch?rev=1559&op=file
==============================================================================
--- experimental/evolution-data-server/debian/patches/112-Bug-612116-IMAPX-Problems-with-separator-.-and-names.patch (added)
+++ experimental/evolution-data-server/debian/patches/112-Bug-612116-IMAPX-Problems-with-separator-.-and-names.patch Thu Mar 11 07:55:31 2010
@@ -1,0 +1,105 @@
+From 3919abeb129f33e93ed00f99f5753790b250cfe6 Mon Sep 17 00:00:00 2001
+From: Chenthill Palanisamy <pchenthill at novell.com>
+Date: Tue, 9 Mar 2010 16:23:39 +0530
+Subject: [PATCH 12/21] Bug 612116 - IMAPX: Problems with separator . and namespace INBOX.
+
+---
+ camel/providers/imapx/camel-imapx-server.c |   16 +++++++++-------
+ camel/providers/imapx/camel-imapx-store.c  |    7 -------
+ 2 files changed, 9 insertions(+), 14 deletions(-)
+
+diff --git a/camel/providers/imapx/camel-imapx-server.c b/camel/providers/imapx/camel-imapx-server.c
+index c1f48c8..8331c8d 100644
+--- a/camel/providers/imapx/camel-imapx-server.c
++++ b/camel/providers/imapx/camel-imapx-server.c
+@@ -491,6 +491,7 @@ imapx_command_addv(CamelIMAPXCommand *ic, const gchar *fmt, va_list ap)
+ 	CamelDataWrapper *D;
+ 	CamelSasl *A;
+ 	gchar buffer[16];
++	CamelFolder *folder;
+ 	gchar *fname = NULL, *encoded = NULL;
+ 	CamelException ex = CAMEL_EXCEPTION_INITIALISER;
+ 
+@@ -592,14 +593,14 @@ imapx_command_addv(CamelIMAPXCommand *ic, const gchar *fmt, va_list ap)
+ 					}
+ 					break;
+ 				case 'f': /* imap folder name */
+-					s = va_arg(ap, gchar *);
++					folder = va_arg(ap, CamelFolder *);
+ 					c(printf("got folder '%s'\n", s));
+-					fname = camel_imapx_store_summary_full_from_path(((CamelIMAPXStore *)ic->job->folder->parent_store)->summary, s);
++					fname = camel_imapx_store_summary_full_from_path(((CamelIMAPXStore *) folder->parent_store)->summary, folder->full_name);
+ 					if (fname) {
+ 						encoded = camel_utf8_utf7(fname);
+ 						g_free (fname);
+ 					} else
+-						encoded = camel_utf8_utf7 (s);
++						encoded = camel_utf8_utf7 (folder->full_name);
+ 
+ 					camel_stream_printf((CamelStream *)ic->mem, "\"%s\"", encoded?encoded:"");
+ 
+@@ -2054,7 +2055,7 @@ imapx_select (CamelIMAPXServer *is, CamelFolder *folder, gboolean forced, CamelE
+ 	/* Hrm, what about reconnecting? */
+ 	is->state = IMAPX_AUTHENTICATED;
+ 
+-	ic = camel_imapx_command_new("SELECT", NULL, "SELECT %s", CIF(folder)->raw_name);
++	ic = camel_imapx_command_new("SELECT", NULL, "SELECT %f", folder);
+ 	ic->complete = imapx_command_select_done;
+ 	imapx_command_start (is, ic);
+ }
+@@ -2286,6 +2287,7 @@ retry:
+ 		imapx_store->summary->namespaces = nsl;
+ 		/* FIXME needs to be identified from list response */
+ 		imapx_store->dir_sep = ns->sep;
++
+ 	}
+ 
+ 	if (!camel_exception_is_set (ex))
+@@ -2432,7 +2434,7 @@ imapx_command_copy_messages_step_start (CamelIMAPXServer *is, CamelIMAPXJob *job
+ 
+ 		res = imapx_uidset_add (&job->u.copy_messages.uidset, ic, uid);
+ 		if (res == 1) {
+-			camel_imapx_command_add (ic, " %f", job->u.copy_messages.dest->full_name);
++			camel_imapx_command_add (ic, " %f", job->u.copy_messages.dest);
+ 			job->u.copy_messages.index = i;
+ 			imapx_command_queue (is, ic);
+ 			return;
+@@ -2570,7 +2572,7 @@ imapx_job_append_message_start(CamelIMAPXServer *is, CamelIMAPXJob *job)
+ 	/* TODO: we could supply the original append date from the file timestamp */
+ 	ic = camel_imapx_command_new("APPEND", NULL,
+ 				     "APPEND %f %F %P",
+-				     job->folder->full_name,
++				     job->folder,
+ 				     ((CamelMessageInfoBase *)job->u.append_message.info)->flags,
+ 				     ((CamelMessageInfoBase *)job->u.append_message.info)->user_flags,
+ 				     job->u.append_message.path);
+@@ -2999,7 +3001,7 @@ imapx_job_refresh_info_start (CamelIMAPXServer *is, CamelIMAPXJob *job)
+ 		guint32 unread;
+ 		CamelIMAPXCommand *ic;
+ 
+-		ic = camel_imapx_command_new ("STATUS", folder->full_name, "STATUS %s (MESSAGES UNSEEN)", folder->full_name);
++		ic = camel_imapx_command_new ("STATUS", folder->full_name, "STATUS %f (MESSAGES UNSEEN)", folder);
+ 		ic->job = job;
+ 		ic->complete = imapx_command_status_done;
+ 		imapx_command_run_sync (is, ic);
+diff --git a/camel/providers/imapx/camel-imapx-store.c b/camel/providers/imapx/camel-imapx-store.c
+index 397c155..b2a001f 100644
+--- a/camel/providers/imapx/camel-imapx-store.c
++++ b/camel/providers/imapx/camel-imapx-store.c
+@@ -478,13 +478,6 @@ imapx_delete_folder_from_cache (CamelIMAPXStore *istore, const gchar *folder_nam
+ 	gchar *state_file;
+ 	gchar *folder_dir, *storage_path;
+ 	CamelFolderInfo *fi;
+-	const gchar *name = NULL;
+-
+-	name = strrchr (folder_name, istore->dir_sep);
+-	if (name)
+-		name++;
+-	else
+-		name = folder_name;
+ 
+ 	storage_path = g_strdup_printf ("%s/folders", istore->storage_path);
+ 	folder_dir = imapx_path_to_physical (storage_path, folder_name);
+-- 
+1.7.0
+

Added: experimental/evolution-data-server/debian/patches/113-Implement-folder-subscriptions-imapx.patch
URL: http://svn.debian.org/wsvn/pkg-evolution/experimental/evolution-data-server/debian/patches/113-Implement-folder-subscriptions-imapx.patch?rev=1559&op=file
==============================================================================
--- experimental/evolution-data-server/debian/patches/113-Implement-folder-subscriptions-imapx.patch (added)
+++ experimental/evolution-data-server/debian/patches/113-Implement-folder-subscriptions-imapx.patch Thu Mar 11 07:55:31 2010
@@ -1,0 +1,268 @@
+From fefd0922d62038905afc744dba5c3a3e02ba3e51 Mon Sep 17 00:00:00 2001
+From: Chenthill Palanisamy <pchenthill at novell.com>
+Date: Tue, 9 Mar 2010 23:48:05 +0530
+Subject: [PATCH 13/21] Implement folder subscriptions - imapx
+
+---
+ camel/providers/imapx/camel-imapx-server.c |   82 ++++++++++++++++++++++++++
+ camel/providers/imapx/camel-imapx-server.h |    2 +
+ camel/providers/imapx/camel-imapx-store.c  |   86 +++++++++++++++++++++++++---
+ 3 files changed, 161 insertions(+), 9 deletions(-)
+
+diff --git a/camel/providers/imapx/camel-imapx-server.c b/camel/providers/imapx/camel-imapx-server.c
+index 8331c8d..cebccdd 100644
+--- a/camel/providers/imapx/camel-imapx-server.c
++++ b/camel/providers/imapx/camel-imapx-server.c
+@@ -182,9 +182,11 @@ enum {
+ 	IMAPX_JOB_NOOP = 1<<7,
+ 	IMAPX_JOB_IDLE = 1<<8,
+ 	IMAPX_JOB_LIST = 1<<9,
++	IMAPX_JOB_MANAGE_SUBSCRIPTION = 1<<10,
+ };
+ 
+ enum {
++	IMAPX_PRIORITY_MANAGE_SUBSCRIPTION = 200,
+ 	IMAPX_PRIORITY_GET_MESSAGE = 100,
+ 	IMAPX_PRIORITY_REFRESH_INFO = 0,
+ 	IMAPX_PRIORITY_NOOP = 0,
+@@ -269,6 +271,11 @@ struct _CamelIMAPXJob {
+ 			guint32 flags;
+ 			GHashTable *folders;
+ 		} list;
++
++		struct {
++			const gchar *folder_name;
++			gboolean subscribe;
++		} manage_subscriptions;
+ 	} u;
+ };
+ 
+@@ -3123,8 +3130,64 @@ imapx_job_list_start(CamelIMAPXServer *is, CamelIMAPXJob *job)
+ 	ic->complete = imapx_command_list_done;
+ 	imapx_command_queue(is, ic);
+ }
++/* ********************************************************************** */
++
++
++static gchar *
++imapx_encode_folder_name (CamelIMAPXStore *istore, const gchar *folder_name)
++{
++	gchar *fname, *encoded;
++
++	fname = camel_imapx_store_summary_full_from_path(istore->summary, folder_name);
++	if (fname) {
++		encoded = camel_utf8_utf7(fname);
++		g_free (fname);
++	} else
++		encoded = camel_utf8_utf7 (folder_name);
++	
++	return encoded;
++}
++
++static void
++imapx_command_subscription_done (CamelIMAPXServer *is, CamelIMAPXCommand *ic)
++{
++	if (camel_exception_is_set (ic->ex) || ic->status->result != IMAPX_OK) {
++		if (!camel_exception_is_set (ic->ex))
++			camel_exception_setv(ic->job->ex, 1, "Error subscribing to folder : %s", ic->status->text);
++		else
++			camel_exception_xfer (ic->job->ex, ic->ex);
++	}
++
++	imapx_job_done (is, ic->job);
++	camel_imapx_command_free (ic);
++}
+ 
+ static void
++imapx_job_manage_subscription_start (CamelIMAPXServer *is, CamelIMAPXJob *job)
++{
++	CamelIMAPXCommand *ic;
++	const gchar *str = NULL;
++	gchar *encoded_fname = NULL;
++	
++	
++	if (job->u.manage_subscriptions.subscribe)
++		str = "SUBSCRIBE";
++	else
++		str = "UNSUBSCRIBE";
++
++	encoded_fname = imapx_encode_folder_name ((CamelIMAPXStore *) is->store, job->u.manage_subscriptions.folder_name);
++	ic = camel_imapx_command_new (str, NULL, "%s %s", str, encoded_fname);
++	
++	ic->pri = job->pri;
++	ic->job = job;
++	ic->complete = imapx_command_subscription_done;
++	imapx_command_queue(is, ic);
++
++	g_free (encoded_fname);
++}
++
++/* ********************************************************************** */
++static void
+ imapx_command_noop_done (CamelIMAPXServer *is, CamelIMAPXCommand *ic)
+ {
+ 	if (camel_exception_is_set (ic->ex) || ic->status->result != IMAPX_OK) {
+@@ -4175,3 +4238,22 @@ camel_imapx_server_list(CamelIMAPXServer *is, const gchar *top, guint32 flags, C
+ 
+ 	return folders;
+ }
++
++void
++camel_imapx_server_manage_subscription (CamelIMAPXServer *is, const gchar *folder_name, gboolean subscribe, CamelException *ex)
++{
++	CamelIMAPXJob *job;
++	
++	job = g_malloc0(sizeof(*job));
++	job->type = IMAPX_JOB_MANAGE_SUBSCRIPTION;
++	job->start = imapx_job_manage_subscription_start;
++	job->pri = IMAPX_PRIORITY_MANAGE_SUBSCRIPTION;
++	job->ex = ex;
++	job->u.manage_subscriptions.subscribe = subscribe;
++	job->u.manage_subscriptions.folder_name = folder_name;
++	
++	if (imapx_register_job (is, job))
++		imapx_run_job (is, job);
++
++	g_free (job);
++}
+diff --git a/camel/providers/imapx/camel-imapx-server.h b/camel/providers/imapx/camel-imapx-server.h
+index 57167d7..ae50e59 100644
+--- a/camel/providers/imapx/camel-imapx-server.h
++++ b/camel/providers/imapx/camel-imapx-server.h
+@@ -125,4 +125,6 @@ void camel_imapx_server_copy_message (CamelIMAPXServer *is, CamelFolder *source,
+ void camel_imapx_server_append_message(CamelIMAPXServer *is, CamelFolder *folder, struct _CamelMimeMessage *message, const struct _CamelMessageInfo *mi, CamelException *ex);
+ void camel_imapx_server_sync_message (CamelIMAPXServer *is, CamelFolder *folder, const gchar *uid, CamelException *ex);
+ 
++void camel_imapx_server_manage_subscription (CamelIMAPXServer *is, const gchar *folder_name, gboolean subscribe, CamelException *ex);
++
+ #endif /* _CAMEL_IMAPX_SERVER_H */
+diff --git a/camel/providers/imapx/camel-imapx-store.c b/camel/providers/imapx/camel-imapx-store.c
+index b2a001f..1a5ad5a 100644
+--- a/camel/providers/imapx/camel-imapx-store.c
++++ b/camel/providers/imapx/camel-imapx-store.c
+@@ -449,10 +449,8 @@ imapx_match_pattern(CamelIMAPXStoreNamespace *ns, const gchar *pattern, const gc
+ }
+ 
+ static void
+-imapx_folder_unsubscribe_from_cache (CamelIMAPXStore *istore,
+-				     const gchar *folder_name, CamelException *ex)
++imapx_unmark_folder_subscribed (CamelIMAPXStore *istore, const gchar *folder_name, gboolean emit_signal, CamelException *ex)
+ {
+-	CamelFolderInfo *fi;
+ 	CamelStoreInfo *si;
+ 
+ 	si = camel_store_summary_path((CamelStoreSummary *)istore->summary, folder_name);
+@@ -465,11 +463,79 @@ imapx_folder_unsubscribe_from_cache (CamelIMAPXStore *istore,
+ 		camel_store_summary_info_free((CamelStoreSummary *)istore->summary, si);
+ 	}
+ 
+-	/* handle rename */
++	if (emit_signal) {
++		CamelFolderInfo *fi;
+ 
+-	fi = imapx_build_folder_info(istore, folder_name);
+-	camel_object_trigger_event (CAMEL_OBJECT (istore), "folder_unsubscribed", fi);
+-	camel_folder_info_free (fi);
++		fi = imapx_build_folder_info(istore, folder_name);
++		camel_object_trigger_event (CAMEL_OBJECT (istore), "folder_unsubscribed", fi);
++		camel_folder_info_free (fi);
++	}
++}
++
++static void
++imapx_mark_folder_subscribed (CamelIMAPXStore *istore, const gchar *folder_name, gboolean emit_signal, CamelException *ex)
++{
++	CamelStoreInfo *si;
++
++	si = camel_store_summary_path((CamelStoreSummary *)istore->summary, folder_name);
++	if (si) {
++		if ((si->flags & CAMEL_STORE_INFO_FOLDER_SUBSCRIBED) == 0) {
++			si->flags |= CAMEL_STORE_INFO_FOLDER_SUBSCRIBED;
++			camel_store_summary_touch((CamelStoreSummary *)istore->summary);
++			camel_store_summary_save((CamelStoreSummary *)istore->summary);
++		}
++		camel_store_summary_info_free((CamelStoreSummary *)istore->summary, si);
++	}
++	
++	if (emit_signal) {
++		CamelFolderInfo *fi;
++
++		fi = imapx_build_folder_info(istore, folder_name);
++		camel_object_trigger_event (CAMEL_OBJECT (istore), "folder_subscribed", fi);
++		camel_folder_info_free (fi);
++	}
++}
++
++static void
++imapx_subscribe_folder (CamelStore *store, const gchar *folder_name, gboolean emit_signal, CamelException *ex)
++{
++	CamelIMAPXStore *istore = (CamelIMAPXStore *) store;
++
++	if (CAMEL_OFFLINE_STORE(store)->state == CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL)
++		return;
++
++	if (istore->server && camel_imapx_server_connect (istore->server, 1))
++		camel_imapx_server_manage_subscription (istore->server, folder_name, TRUE, ex);
++
++	if (!camel_exception_is_set (ex))
++		imapx_mark_folder_subscribed (istore, folder_name, emit_signal, ex);
++}
++
++static void
++imapx_unsubscribe_folder (CamelStore *store, const gchar *folder_name, gboolean emit_signal, CamelException *ex)
++{
++	CamelIMAPXStore *istore = (CamelIMAPXStore *) store;
++
++	if (CAMEL_OFFLINE_STORE(store)->state == CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL)
++		return;
++
++	if (istore->server && camel_imapx_server_connect (istore->server, 1))
++		camel_imapx_server_manage_subscription (istore->server, folder_name, FALSE, ex);
++	
++	if (!camel_exception_is_set (ex))
++		imapx_unmark_folder_subscribed (istore, folder_name, emit_signal, ex);
++}
++
++static void
++imapx_store_subscribe_folder (CamelStore *store, const gchar *folder_name, CamelException *ex)
++{
++	imapx_subscribe_folder (store, folder_name, TRUE, ex);
++}
++
++static void
++imapx_store_unsubscribe_folder (CamelStore *store, const gchar *folder_name, CamelException *ex)
++{
++	imapx_unsubscribe_folder (store, folder_name, TRUE, ex);
+ }
+ 
+ static void
+@@ -830,7 +896,7 @@ sync_folders (CamelIMAPXStore *istore, const gchar *pattern, CamelException *ex)
+ 					CamelException eex;
+ 
+ 					camel_exception_init (&eex);
+-					imapx_folder_unsubscribe_from_cache (istore,dup_folder_name, &eex);
++					imapx_unmark_folder_subscribed (istore,dup_folder_name, TRUE, &eex);
+ 					imapx_delete_folder_from_cache (istore, dup_folder_name, &eex);
+ 					
+ 					g_free (dup_folder_name);
+@@ -962,6 +1028,8 @@ camel_imapx_store_class_init(CamelIMAPXStoreClass *klass)
+ 	camel_store_class->create_folder = imapx_create_folder;
+ 	camel_store_class->rename_folder = imapx_rename_folder;
+ 	camel_store_class->delete_folder = imapx_delete_folder;
++	camel_store_class->subscribe_folder = imapx_store_subscribe_folder;
++	camel_store_class->unsubscribe_folder = imapx_store_unsubscribe_folder;
+ 	camel_store_class->get_folder_info = imapx_get_folder_info;
+ 	camel_store_class->folder_subscribed = imapx_folder_subscribed;
+ 	camel_store_class->free_folder_info = camel_store_free_folder_info_full;
+@@ -975,7 +1043,7 @@ camel_imapx_store_init (gpointer object, gpointer klass)
+ {
+ 	CamelStore *store = (CamelStore *) object;
+ 
+-	store->flags |= CAMEL_STORE_ASYNC;
++	store->flags |= CAMEL_STORE_ASYNC | CAMEL_STORE_SUBSCRIPTIONS;
+ }
+ 
+ static void
+-- 
+1.7.0
+

Added: experimental/evolution-data-server/debian/patches/114-Ensure-inbox-is-subscribed-if-lsub-is-used-during-in.patch
URL: http://svn.debian.org/wsvn/pkg-evolution/experimental/evolution-data-server/debian/patches/114-Ensure-inbox-is-subscribed-if-lsub-is-used-during-in.patch?rev=1559&op=file
==============================================================================
--- experimental/evolution-data-server/debian/patches/114-Ensure-inbox-is-subscribed-if-lsub-is-used-during-in.patch (added)
+++ experimental/evolution-data-server/debian/patches/114-Ensure-inbox-is-subscribed-if-lsub-is-used-during-in.patch Thu Mar 11 07:55:31 2010
@@ -1,0 +1,53 @@
+From 3a3727de4c65a97b136fcd6d4ae27af0a3665f24 Mon Sep 17 00:00:00 2001
+From: Chenthill Palanisamy <pchenthill at novell.com>
+Date: Wed, 10 Mar 2010 00:18:27 +0530
+Subject: [PATCH 14/21] Ensure inbox is subscribed if lsub is used during initial setup. - imapx
+
+---
+ camel/providers/imapx/camel-imapx-store.c |   20 ++++++++++++++++++++
+ 1 files changed, 20 insertions(+), 0 deletions(-)
+
+diff --git a/camel/providers/imapx/camel-imapx-store.c b/camel/providers/imapx/camel-imapx-store.c
+index 1a5ad5a..56547e2 100644
+--- a/camel/providers/imapx/camel-imapx-store.c
++++ b/camel/providers/imapx/camel-imapx-store.c
+@@ -921,6 +921,7 @@ imapx_get_folder_info(CamelStore *store, const gchar *top, guint32 flags, CamelE
+ {
+ 	CamelIMAPXStore *istore = (CamelIMAPXStore *)store;
+ 	CamelFolderInfo * fi= NULL;
++	gboolean initial_setup = FALSE;
+ 
+ 	if (top == NULL)
+ 		top = "";
+@@ -933,9 +934,28 @@ imapx_get_folder_info(CamelStore *store, const gchar *top, guint32 flags, CamelE
+ 	if (!camel_service_connect((CamelService *)store, ex))
+ 		return NULL;
+ 
++	if (camel_store_summary_count ((CamelStoreSummary *) istore->summary) == 0)
++		initial_setup = TRUE;
++
+ 	sync_folders (istore, top, ex);
+ 	camel_store_summary_save((CamelStoreSummary *) istore->summary);
+ 
++	/* ensure the INBOX is subscribed if lsub was preferred*/
++	if (initial_setup && istore->rec_options & IMAPX_SUBSCRIPTIONS) {
++		CamelStoreInfo *si;
++		
++		si = camel_store_summary_path((CamelStoreSummary *) istore->summary, "INBOX");
++		if (si == NULL || (si->flags & CAMEL_FOLDER_SUBSCRIBED) == 0) {
++			imapx_subscribe_folder (store, "INBOX", FALSE, ex);
++			
++			if (!camel_exception_is_set(ex) && !si)
++				sync_folders (istore, "INBOX", ex);
++		
++			if (si)
++				camel_store_summary_info_free((CamelStoreSummary *) istore->summary, si);
++		}
++	}
++
+ 	fi = get_folder_info_offline (store, top, flags, ex);
+ 	return fi;
+ }
+-- 
+1.7.0
+

Added: experimental/evolution-data-server/debian/patches/115-implement-create-folder-imapx.patch
URL: http://svn.debian.org/wsvn/pkg-evolution/experimental/evolution-data-server/debian/patches/115-implement-create-folder-imapx.patch?rev=1559&op=file
==============================================================================
--- experimental/evolution-data-server/debian/patches/115-implement-create-folder-imapx.patch (added)
+++ experimental/evolution-data-server/debian/patches/115-implement-create-folder-imapx.patch Thu Mar 11 07:55:31 2010
@@ -1,0 +1,256 @@
+From f09f0fdd0222ad1017fc820715abb783a65df94a Mon Sep 17 00:00:00 2001
+From: Chenthill Palanisamy <pchenthill at novell.com>
+Date: Wed, 10 Mar 2010 02:02:56 +0530
+Subject: [PATCH 15/21] implement create folder - imapx
+
+---
+ camel/providers/imapx/camel-imapx-server.c |   62 ++++++++++++++++
+ camel/providers/imapx/camel-imapx-server.h |    1 +
+ camel/providers/imapx/camel-imapx-store.c  |  109 +++++++++++++++++++++++-----
+ 3 files changed, 153 insertions(+), 19 deletions(-)
+
+diff --git a/camel/providers/imapx/camel-imapx-server.c b/camel/providers/imapx/camel-imapx-server.c
+index cebccdd..0ea9915 100644
+--- a/camel/providers/imapx/camel-imapx-server.c
++++ b/camel/providers/imapx/camel-imapx-server.c
+@@ -183,9 +183,11 @@ enum {
+ 	IMAPX_JOB_IDLE = 1<<8,
+ 	IMAPX_JOB_LIST = 1<<9,
+ 	IMAPX_JOB_MANAGE_SUBSCRIPTION = 1<<10,
++	IMAPX_JOB_CREATE_FOLDER = 1<<11,
+ };
+ 
+ enum {
++	IMAPX_PRIORITY_CREATE_FOLDER = 200,
+ 	IMAPX_PRIORITY_MANAGE_SUBSCRIPTION = 200,
+ 	IMAPX_PRIORITY_GET_MESSAGE = 100,
+ 	IMAPX_PRIORITY_REFRESH_INFO = 0,
+@@ -276,6 +278,8 @@ struct _CamelIMAPXJob {
+ 			const gchar *folder_name;
+ 			gboolean subscribe;
+ 		} manage_subscriptions;
++
++		const gchar *folder_name;
+ 	} u;
+ };
+ 
+@@ -1122,9 +1126,15 @@ imapx_untagged(CamelIMAPXServer *imap, CamelException *ex)
+ 		nsl = imapx_parse_namespace_list (imap->stream, ex);
+ 		if (nsl != NULL) {
+ 			CamelIMAPXStore *imapx_store = (CamelIMAPXStore *) imap->store;
++			CamelIMAPXStoreNamespace *ns;
+ 
+ 			imapx_store->summary->namespaces = nsl;
+ 			camel_store_summary_touch ((CamelStoreSummary *) imapx_store->summary);
++
++			/* TODO Need to remove imapx_store->dir_sep to support multiple namespaces */
++			ns = nsl->personal;
++			if (ns)
++				imapx_store->dir_sep = ns->sep;
+ 		}
+ 
+ 		return 0;
+@@ -3187,6 +3197,39 @@ imapx_job_manage_subscription_start (CamelIMAPXServer *is, CamelIMAPXJob *job)
+ }
+ 
+ /* ********************************************************************** */
++
++static void
++imapx_command_create_folder_done (CamelIMAPXServer *is, CamelIMAPXCommand *ic)
++{
++	if (camel_exception_is_set (ic->ex) || ic->status->result != IMAPX_OK) {
++		if (!camel_exception_is_set (ic->ex))
++			camel_exception_setv(ic->job->ex, 1, "Error creating to folder : %s", ic->status->text);
++		else
++			camel_exception_xfer (ic->job->ex, ic->ex);
++	}
++
++	imapx_job_done (is, ic->job);
++	camel_imapx_command_free (ic);
++}
++
++static void
++imapx_job_create_folder_start (CamelIMAPXServer *is, CamelIMAPXJob *job)
++{
++	CamelIMAPXCommand *ic;
++	gchar *encoded_fname = NULL;
++
++	encoded_fname = camel_utf8_utf7 (job->u.folder_name);
++	ic = camel_imapx_command_new ("CREATE", NULL, "CREATE %s", encoded_fname);
++	ic->pri = job->pri;
++	ic->job = job;
++	ic->complete = imapx_command_create_folder_done;
++	imapx_command_queue(is, ic);
++
++	g_free (encoded_fname);
++}
++
++/* ********************************************************************** */
++
+ static void
+ imapx_command_noop_done (CamelIMAPXServer *is, CamelIMAPXCommand *ic)
+ {
+@@ -4257,3 +4300,22 @@ camel_imapx_server_manage_subscription (CamelIMAPXServer *is, const gchar *folde
+ 
+ 	g_free (job);
+ }
++
++void
++camel_imapx_server_create_folder (CamelIMAPXServer *is, const gchar *folder_name, CamelException *ex)
++{
++	CamelIMAPXJob *job;
++	
++	job = g_malloc0(sizeof(*job));
++	job->type = IMAPX_JOB_CREATE_FOLDER;
++	job->start = imapx_job_create_folder_start;
++	job->pri = IMAPX_PRIORITY_CREATE_FOLDER;
++	job->ex = ex;
++	job->u.folder_name = folder_name;
++
++	if (imapx_register_job (is, job))
++		imapx_run_job (is, job);
++
++	g_free (job);
++}
++
+diff --git a/camel/providers/imapx/camel-imapx-server.h b/camel/providers/imapx/camel-imapx-server.h
+index ae50e59..9dc9b91 100644
+--- a/camel/providers/imapx/camel-imapx-server.h
++++ b/camel/providers/imapx/camel-imapx-server.h
+@@ -126,5 +126,6 @@ void camel_imapx_server_append_message(CamelIMAPXServer *is, CamelFolder *folder
+ void camel_imapx_server_sync_message (CamelIMAPXServer *is, CamelFolder *folder, const gchar *uid, CamelException *ex);
+ 
+ void camel_imapx_server_manage_subscription (CamelIMAPXServer *is, const gchar *folder_name, gboolean subscribe, CamelException *ex);
++void camel_imapx_server_create_folder (CamelIMAPXServer *is, const gchar *folder_name, CamelException *ex);
+ 
+ #endif /* _CAMEL_IMAPX_SERVER_H */
+diff --git a/camel/providers/imapx/camel-imapx-store.c b/camel/providers/imapx/camel-imapx-store.c
+index 56547e2..efd7462 100644
+--- a/camel/providers/imapx/camel-imapx-store.c
++++ b/camel/providers/imapx/camel-imapx-store.c
+@@ -577,6 +577,96 @@ imapx_delete_folder_from_cache (CamelIMAPXStore *istore, const gchar *folder_nam
+ 	camel_folder_info_free (fi);
+ }
+ 
++static void
++imapx_delete_folder (CamelStore *store, const gchar *folder_name, CamelException *ex)
++{
++	camel_exception_setv(ex, 1, "delete_folder::unimplemented");
++}
++
++static void
++imapx_rename_folder (CamelStore *store, const gchar *old, const gchar *new, CamelException *ex)
++{
++	camel_exception_setv(ex, 1, "rename_folder::unimplemented");
++}
++
++static CamelFolderInfo *
++imapx_create_folder (CamelStore *store, const gchar *parent_name, const gchar *folder_name, CamelException *ex)
++{	
++	const gchar *c;
++	CamelStoreInfo *si;
++	CamelIMAPXStoreNamespace *ns;
++	CamelIMAPXStore *istore = (CamelIMAPXStore *) store;
++	gchar *real_name, *full_name, *parent_real;
++	CamelFolderInfo *fi = NULL;
++	gchar dir_sep;
++	
++	if (CAMEL_OFFLINE_STORE (store)->state == CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL) {
++		camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
++				     _("You must be working online to complete this operation"));
++		return NULL;
++	}
++	
++	if (!parent_name)
++		parent_name = "";
++
++	ns = camel_imapx_store_summary_namespace_find_path (istore->summary, parent_name);
++	if (ns)
++		dir_sep = ns->sep;
++	else
++		dir_sep = '/';
++
++	c = folder_name;
++	while (*c && *c != dir_sep && !strchr ("#%*", *c))
++		c++;
++
++	if (*c != '\0') {
++		camel_exception_setv (ex, CAMEL_EXCEPTION_FOLDER_INVALID_PATH,
++				      _("The folder name \"%s\" is invalid because it contains the character \"%c\""),
++				      folder_name, *c);
++		return NULL;
++	}
++	
++	parent_real = camel_imapx_store_summary_full_from_path(istore->summary, parent_name);
++	si = camel_store_summary_path ((CamelStoreSummary *)istore->summary, parent_name);
++	if (si == NULL || parent_real == NULL) {
++		camel_exception_setv(ex, CAMEL_EXCEPTION_FOLDER_INVALID_STATE,
++				     _("Unknown parent folder: %s"), parent_name);
++		return NULL;
++	}
++
++	if (si->flags & CAMEL_STORE_INFO_FOLDER_NOINFERIORS) {
++		camel_exception_set (ex, CAMEL_EXCEPTION_FOLDER_INVALID_STATE,
++				_("The parent folder is not allowed to contain subfolders"));
++		return NULL;
++	}
++
++	camel_store_summary_info_free ((CamelStoreSummary *) istore->summary, si);
++
++	real_name = camel_imapx_store_summary_path_to_full (istore->summary, folder_name, dir_sep);
++	full_name = imapx_concat (istore, parent_real, real_name);
++	g_free(real_name);
++
++	if (istore->server && camel_imapx_server_connect (istore->server, 1))
++		camel_imapx_server_create_folder (istore->server, full_name, ex);
++
++	if (!camel_exception_is_set (ex)) {
++		CamelIMAPXStoreInfo *si;
++
++		si = camel_imapx_store_summary_add_from_full(istore->summary, full_name, dir_sep);
++		camel_store_summary_save((CamelStoreSummary *)istore->summary);
++		fi = imapx_build_folder_info(istore, camel_store_info_path(istore->summary, si));
++		fi->flags |= CAMEL_FOLDER_NOCHILDREN;
++		camel_object_trigger_event (CAMEL_OBJECT (store), "folder_created", fi);
++	}
++
++
++	g_free (full_name);
++	g_free(parent_real);
++
++	return fi;
++}
++
++
+ static CamelFolderInfo *
+ get_folder_info_offline (CamelStore *store, const gchar *top,
+ 			 guint32 flags, CamelException *ex)
+@@ -960,25 +1050,6 @@ imapx_get_folder_info(CamelStore *store, const gchar *top, guint32 flags, CamelE
+ 	return fi;
+ }
+ 
+-static void
+-imapx_delete_folder(CamelStore *store, const gchar *folder_name, CamelException *ex)
+-{
+-	camel_exception_setv(ex, 1, "delete_folder::unimplemented");
+-}
+-
+-static void
+-imapx_rename_folder(CamelStore *store, const gchar *old, const gchar *new, CamelException *ex)
+-{
+-	camel_exception_setv(ex, 1, "rename_folder::unimplemented");
+-}
+-
+-static CamelFolderInfo *
+-imapx_create_folder(CamelStore *store, const gchar *parent_name, const gchar *folder_name, CamelException *ex)
+-{
+-	camel_exception_setv(ex, 1, "create_folder::unimplemented");
+-	return NULL;
+-}
+-
+ static gboolean
+ imapx_can_refresh_folder (CamelStore *store, CamelFolderInfo *info, CamelException *ex)
+ {
+-- 
+1.7.0
+

Added: experimental/evolution-data-server/debian/patches/116-Bug-604047-Use-accessor-functions-instead-of-direct-.patch
URL: http://svn.debian.org/wsvn/pkg-evolution/experimental/evolution-data-server/debian/patches/116-Bug-604047-Use-accessor-functions-instead-of-direct-.patch?rev=1559&op=file
==============================================================================
--- experimental/evolution-data-server/debian/patches/116-Bug-604047-Use-accessor-functions-instead-of-direct-.patch (added)
+++ experimental/evolution-data-server/debian/patches/116-Bug-604047-Use-accessor-functions-instead-of-direct-.patch Thu Mar 11 07:55:31 2010
@@ -1,0 +1,127 @@
+From fcd0295bdc9427e51b6db6f1d5ef4acb40e8384a Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Javier=20Jard=C3=B3n?= <jjardon at gnome.org>
+Date: Tue, 9 Mar 2010 23:00:48 -0500
+Subject: [PATCH 16/21] Bug 604047 - Use accessor functions instead of direct access
+
+---
+ configure.ac                            |    2 +-
+ libedataserverui/e-name-selector-list.c |   26 ++++++++++++++++++--------
+ 2 files changed, 19 insertions(+), 9 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 632ebdc..9f376dd 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -33,7 +33,7 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
+ 
+ dnl Required Package Versions
+ m4_define([glib_minimum_version], [2.16.1])
+-m4_define([gtk_minimum_version], [2.14.0])
++m4_define([gtk_minimum_version], [2.18.0])
+ m4_define([gconf_minimum_version], [2.0.0])		dnl XXX Just a Guess
+ m4_define([libxml_minimum_version], [2.0.0])		dnl XXX Just a Guess
+ m4_define([libsoup_minimum_version], [2.3.0])
+diff --git a/libedataserverui/e-name-selector-list.c b/libedataserverui/e-name-selector-list.c
+index afdc700..2b14601 100644
+--- a/libedataserverui/e-name-selector-list.c
++++ b/libedataserverui/e-name-selector-list.c
+@@ -50,6 +50,7 @@ static void
+ enl_popup_size (ENameSelectorList *list)
+ {
+ 	gint height = 0, count;
++	GtkAllocation allocation;
+ 	GtkTreeViewColumn *column = NULL;
+ 
+ 	column = gtk_tree_view_get_column ( GTK_TREE_VIEW (list->tree_view), 0);
+@@ -63,19 +64,23 @@ enl_popup_size (ENameSelectorList *list)
+ 	if (count <= 0)
+ 		count = 1;
+ 
+-	gtk_widget_set_size_request (list->tree_view, ((GtkWidget *)list)->allocation.width - 3 , height * count);
++	gtk_widget_get_allocation (GTK_WIDGET (list), &allocation);
++	gtk_widget_set_size_request (list->tree_view, allocation.width - 3 , height * count);
+ }
+ 
+ static void
+ enl_popup_position (ENameSelectorList *list)
+ {
++	GtkAllocation allocation;
+ 	GdkWindow *window;
+ 	gint x,y;
+ 
++	gtk_widget_get_allocation (GTK_WIDGET (list), &allocation);
++
+ 	enl_popup_size (list);
+ 	window = gtk_widget_get_window (GTK_WIDGET (list));
+ 	gdk_window_get_origin (window, &x, &y);
+-	y = y +((GtkWidget *)list)->allocation.height;
++	y = y + allocation.height;
+ 
+ 	gtk_window_move (list->popup, x, y);
+ }
+@@ -110,11 +115,11 @@ enl_popup_grab (ENameSelectorList *list)
+ static void
+ enl_popup_ungrab (ENameSelectorList *list)
+ {
+-	if (!GTK_WIDGET_HAS_GRAB(list->popup))
++	if (!gtk_widget_has_grab (GTK_WIDGET (list->popup)))
+ 		return;
+ 
+ 	gdk_pointer_ungrab (GDK_CURRENT_TIME);
+-	gtk_grab_remove ( GTK_WIDGET (list->popup));
++	gtk_grab_remove (GTK_WIDGET (list->popup));
+ 	gdk_keyboard_ungrab (GDK_CURRENT_TIME);
+ }
+ 
+@@ -134,7 +139,8 @@ static gboolean
+ enl_entry_focus_out (ENameSelectorList *list, GdkEventFocus *event, gpointer dummy)
+ {
+ 	/* When we lose focus and popup is still present hide it. Dont do it, when we click the popup. Look for grab */
+-	if (GTK_WIDGET_VISIBLE (list->popup) && !GTK_WIDGET_HAS_GRAB(list->popup)) {
++	if (gtk_widget_get_visible (GTK_WIDGET (list->popup))
++            && !gtk_widget_has_grab (GTK_WIDGET (list->popup))) {
+ 		enl_popup_ungrab (list);
+ 		gtk_widget_hide ((GtkWidget *)list->popup);
+ 
+@@ -149,7 +155,11 @@ enl_popup_button_press (GtkWidget *widget,
+ 			GdkEventButton *event,
+ 			ENameSelectorList *list)
+ {
++#if GTK_CHECK_VERSION (2,19,5)
++	if (!gtk_widget_get_mapped (widget))
++#else
+ 	if (!GTK_WIDGET_MAPPED (widget))
++#endif
+ 		return FALSE;
+ 	/* if we come here, it's usually time to popdown */
+ 	gtk_widget_hide ((GtkWidget *)list->popup);
+@@ -172,7 +182,7 @@ enl_popup_enter_notify (GtkWidget        *widget,
+ 			GdkEventCrossing *event,
+ 			ENameSelectorList *list)
+ {
+-  if (event->type == GDK_ENTER_NOTIFY && !GTK_WIDGET_HAS_GRAB (list->popup))
++  if (event->type == GDK_ENTER_NOTIFY && !gtk_widget_has_grab (GTK_WIDGET (list->popup)))
+ 	enl_popup_grab (list);
+ 
+   return TRUE;
+@@ -357,7 +367,7 @@ enl_tree_button_press_event (GtkWidget *widget,
+ 	PopupDeleteRowInfo *row_info;
+ 	GtkTreeIter   iter;
+ 
+-	if ( !GTK_WIDGET_HAS_GRAB (list->popup))
++	if (!gtk_widget_has_grab (GTK_WIDGET (list->popup)))
+ 		enl_popup_grab (list);
+ 
+ 	gtk_tree_view_get_dest_row_at_pos(GTK_TREE_VIEW (list->tree_view), event->x, event->y, &path, NULL);
+@@ -518,7 +528,7 @@ void
+ e_name_selector_list_expand_clicked(ENameSelectorList *list)
+ {
+ 
+-	if (!GTK_WIDGET_VISIBLE (list->popup)) {
++	if (!gtk_widget_get_visible (GTK_WIDGET (list->popup))) {
+ 		enl_popup_position (list);
+ 		gtk_widget_show_all (GTK_WIDGET (list->popup));
+ 		enl_popup_grab (list);
+-- 
+1.7.0
+

Added: experimental/evolution-data-server/debian/patches/117-Implement-folder_delete-imapx.patch
URL: http://svn.debian.org/wsvn/pkg-evolution/experimental/evolution-data-server/debian/patches/117-Implement-folder_delete-imapx.patch?rev=1559&op=file
==============================================================================
--- experimental/evolution-data-server/debian/patches/117-Implement-folder_delete-imapx.patch (added)
+++ experimental/evolution-data-server/debian/patches/117-Implement-folder_delete-imapx.patch Thu Mar 11 07:55:31 2010
@@ -1,0 +1,348 @@
+From e329ffa364e3cb389ad9e7295a1b276bef435d7c Mon Sep 17 00:00:00 2001
+From: Chenthill Palanisamy <pchenthill at novell.com>
+Date: Wed, 10 Mar 2010 13:48:49 +0530
+Subject: [PATCH 17/21] Implement folder_delete - imapx
+ Bug 612388 - [imapx] can't move message from a folder to another
+
+---
+ camel/providers/imapx/camel-imapx-server.c        |   67 +++++++++++++++++-
+ camel/providers/imapx/camel-imapx-server.h        |    1 +
+ camel/providers/imapx/camel-imapx-store-summary.c |    6 +-
+ camel/providers/imapx/camel-imapx-store-summary.h |    6 +-
+ camel/providers/imapx/camel-imapx-store.c         |   77 ++++++++++++++++----
+ camel/providers/imapx/camel-imapx-utils.c         |    5 +-
+ 6 files changed, 135 insertions(+), 27 deletions(-)
+
+diff --git a/camel/providers/imapx/camel-imapx-server.c b/camel/providers/imapx/camel-imapx-server.c
+index 0ea9915..832c140 100644
+--- a/camel/providers/imapx/camel-imapx-server.c
++++ b/camel/providers/imapx/camel-imapx-server.c
+@@ -184,10 +184,14 @@ enum {
+ 	IMAPX_JOB_LIST = 1<<9,
+ 	IMAPX_JOB_MANAGE_SUBSCRIPTION = 1<<10,
+ 	IMAPX_JOB_CREATE_FOLDER = 1<<11,
++	IMAPX_JOB_DELETE_FOLDER = 1<<12,
+ };
+ 
++/* Operations on the store (folder_tree) will have highest priority as we know for sure they are sync
++   and user triggered. */
+ enum {
+ 	IMAPX_PRIORITY_CREATE_FOLDER = 200,
++	IMAPX_PRIORITY_DELETE_FOLDER = 200,
+ 	IMAPX_PRIORITY_MANAGE_SUBSCRIPTION = 200,
+ 	IMAPX_PRIORITY_GET_MESSAGE = 100,
+ 	IMAPX_PRIORITY_REFRESH_INFO = 0,
+@@ -2460,7 +2464,7 @@ imapx_command_copy_messages_step_start (CamelIMAPXServer *is, CamelIMAPXJob *job
+ 
+ 	job->u.copy_messages.index = i;
+ 	if (imapx_uidset_done (&job->u.copy_messages.uidset, ic)) {
+-		camel_imapx_command_add (ic, " %s", job->u.copy_messages.dest->full_name);
++		camel_imapx_command_add (ic, " %f", job->u.copy_messages.dest);
+ 		imapx_command_queue (is, ic);
+ 		return;
+ 	}
+@@ -3231,6 +3235,40 @@ imapx_job_create_folder_start (CamelIMAPXServer *is, CamelIMAPXJob *job)
+ /* ********************************************************************** */
+ 
+ static void
++imapx_command_delete_folder_done (CamelIMAPXServer *is, CamelIMAPXCommand *ic)
++{
++	if (camel_exception_is_set (ic->ex) || ic->status->result != IMAPX_OK) {
++		if (!camel_exception_is_set (ic->ex))
++			camel_exception_setv(ic->job->ex, 1, "Error deleting to folder : %s", ic->status->text);
++		else
++			camel_exception_xfer (ic->job->ex, ic->ex);
++	}
++
++	imapx_job_done (is, ic->job);
++	camel_imapx_command_free (ic);
++}
++
++static void
++imapx_job_delete_folder_start (CamelIMAPXServer *is, CamelIMAPXJob *job)
++{
++	CamelIMAPXCommand *ic;
++	gchar *encoded_fname = NULL;
++
++	encoded_fname = imapx_encode_folder_name ((CamelIMAPXStore *) is->store, job->u.folder_name);
++
++	/* make sure to-be-deleted folder is not selected by selecting INBOX for this operation */
++	ic = camel_imapx_command_new ("DELETE", "INBOX", "DELETE %s", encoded_fname);
++	ic->pri = job->pri;
++	ic->job = job;
++	ic->complete = imapx_command_delete_folder_done;
++	imapx_command_queue(is, ic);
++
++	g_free (encoded_fname);
++}
++
++/* ********************************************************************** */
++
++static void
+ imapx_command_noop_done (CamelIMAPXServer *is, CamelIMAPXCommand *ic)
+ {
+ 	if (camel_exception_is_set (ic->ex) || ic->status->result != IMAPX_OK) {
+@@ -4254,6 +4292,9 @@ camel_imapx_server_list(CamelIMAPXServer *is, const gchar *top, guint32 flags, C
+ {
+ 	CamelIMAPXJob *job;
+ 	GPtrArray *folders = NULL;
++	gchar *encoded_name;
++
++	encoded_name = camel_utf8_utf7 (top);
+ 
+ 	job = g_malloc0(sizeof(*job));
+ 	job->type = IMAPX_JOB_LIST;
+@@ -4262,11 +4303,11 @@ camel_imapx_server_list(CamelIMAPXServer *is, const gchar *top, guint32 flags, C
+ 	job->ex = ex;
+ 	job->u.list.flags = flags;
+ 	job->u.list.folders = g_hash_table_new(imapx_name_hash, imapx_name_equal);
+-	job->u.list.pattern = g_alloca(strlen(top)+5);
++	job->u.list.pattern = g_alloca(strlen(encoded_name)+5);
+ 	if (flags & CAMEL_STORE_FOLDER_INFO_RECURSIVE)
+-		sprintf(job->u.list.pattern, "%s*", top);
++		sprintf(job->u.list.pattern, "%s*", encoded_name);
+ 	else
+-		sprintf(job->u.list.pattern, "%s", top);
++		sprintf(job->u.list.pattern, "%s", encoded_name);
+ 
+ 	if (imapx_register_job (is, job)) {
+ 		imapx_run_job (is, job);
+@@ -4277,6 +4318,7 @@ camel_imapx_server_list(CamelIMAPXServer *is, const gchar *top, guint32 flags, C
+ 	}
+ 
+ 	g_hash_table_destroy(job->u.list.folders);
++	g_free (encoded_name);
+ 	g_free(job);
+ 
+ 	return folders;
+@@ -4319,3 +4361,20 @@ camel_imapx_server_create_folder (CamelIMAPXServer *is, const gchar *folder_name
+ 	g_free (job);
+ }
+ 
++void
++camel_imapx_server_delete_folder (CamelIMAPXServer *is, const gchar *folder_name, CamelException *ex)
++{
++	CamelIMAPXJob *job;
++	
++	job = g_malloc0(sizeof(*job));
++	job->type = IMAPX_JOB_DELETE_FOLDER;
++	job->start = imapx_job_delete_folder_start;
++	job->pri = IMAPX_PRIORITY_DELETE_FOLDER;
++	job->ex = ex;
++	job->u.folder_name = folder_name;
++
++	if (imapx_register_job (is, job))
++		imapx_run_job (is, job);
++
++	g_free (job);
++}
+diff --git a/camel/providers/imapx/camel-imapx-server.h b/camel/providers/imapx/camel-imapx-server.h
+index 9dc9b91..eba2adb 100644
+--- a/camel/providers/imapx/camel-imapx-server.h
++++ b/camel/providers/imapx/camel-imapx-server.h
+@@ -127,5 +127,6 @@ void camel_imapx_server_sync_message (CamelIMAPXServer *is, CamelFolder *folder,
+ 
+ void camel_imapx_server_manage_subscription (CamelIMAPXServer *is, const gchar *folder_name, gboolean subscribe, CamelException *ex);
+ void camel_imapx_server_create_folder (CamelIMAPXServer *is, const gchar *folder_name, CamelException *ex);
++void camel_imapx_server_delete_folder (CamelIMAPXServer *is, const gchar *folder_name, CamelException *ex);
+ 
+ #endif /* _CAMEL_IMAPX_SERVER_H */
+diff --git a/camel/providers/imapx/camel-imapx-store-summary.c b/camel/providers/imapx/camel-imapx-store-summary.c
+index 01ec307..e46caa7 100644
+--- a/camel/providers/imapx/camel-imapx-store-summary.c
++++ b/camel/providers/imapx/camel-imapx-store-summary.c
+@@ -333,7 +333,7 @@ camel_imapx_store_summary_add_from_full(CamelIMAPXStoreSummary *s, const gchar *
+ 	info = (CamelIMAPXStoreInfo *)camel_store_summary_add_from_path((CamelStoreSummary *)s, pathu8);
+ 	if (info) {
+ 		d(printf("  '%s' -> '%s'\n", pathu8, full_name));
+-		camel_store_info_set_string((CamelStoreSummary *)s, (CamelStoreInfo *)info, CAMEL_IMAP_STORE_INFO_FULL_NAME, full_name);
++		camel_store_info_set_string((CamelStoreSummary *)s, (CamelStoreInfo *)info, CAMEL_IMAPX_STORE_INFO_FULL_NAME, full_name);
+ 
+ 		if (!g_ascii_strcasecmp(full_name, "inbox"))
+ 			info->info.flags |= CAMEL_FOLDER_SYSTEM|CAMEL_FOLDER_TYPE_INBOX;
+@@ -649,7 +649,7 @@ store_info_string(CamelStoreSummary *s, const CamelStoreInfo *mi, gint type)
+ 	g_assert (mi != NULL);
+ 
+ 	switch (type) {
+-	case CAMEL_IMAP_STORE_INFO_FULL_NAME:
++	case CAMEL_IMAPX_STORE_INFO_FULL_NAME:
+ 		return isi->full_name;
+ 	default:
+ 		return camel_imapx_store_summary_parent->store_info_string(s, mi, type);
+@@ -664,7 +664,7 @@ store_info_set_string(CamelStoreSummary *s, CamelStoreInfo *mi, gint type, const
+ 	g_assert(mi != NULL);
+ 
+ 	switch (type) {
+-	case CAMEL_IMAP_STORE_INFO_FULL_NAME:
++	case CAMEL_IMAPX_STORE_INFO_FULL_NAME:
+ 		d(printf("Set full name %s -> %s\n", isi->full_name, str));
+ 		CAMEL_STORE_SUMMARY_LOCK(s, summary_lock);
+ 		g_free(isi->full_name);
+diff --git a/camel/providers/imapx/camel-imapx-store-summary.h b/camel/providers/imapx/camel-imapx-store-summary.h
+index 67f4004..1da5b2c 100644
+--- a/camel/providers/imapx/camel-imapx-store-summary.h
++++ b/camel/providers/imapx/camel-imapx-store-summary.h
+@@ -37,8 +37,8 @@ typedef struct _CamelIMAPXStoreSummaryClass CamelIMAPXStoreSummaryClass;
+ typedef struct _CamelIMAPXStoreInfo CamelIMAPXStoreInfo;
+ 
+ enum {
+-	CAMEL_IMAP_STORE_INFO_FULL_NAME = CAMEL_STORE_INFO_LAST,
+-	CAMEL_IMAP_STORE_INFO_LAST
++	CAMEL_IMAPX_STORE_INFO_FULL_NAME = CAMEL_STORE_INFO_LAST,
++	CAMEL_IMAPX_STORE_INFO_LAST
+ };
+ 
+ struct _CamelIMAPXStoreInfo {
+@@ -98,7 +98,7 @@ gchar *camel_imapx_store_summary_full_from_path(CamelIMAPXStoreSummary *s, const
+ void camel_imapx_store_summary_set_namespaces (CamelIMAPXStoreSummary *summary, const CamelIMAPXNamespaceList *nsl);
+ 
+ /* helpe macro's */
+-#define camel_imapx_store_info_full_name(s, i) (camel_store_info_string((CamelStoreSummary *)s, (const CamelStoreInfo *)i, CAMEL_IMAP_STORE_INFO_FULL_NAME))
++#define camel_imapx_store_info_full_name(s, i) (camel_store_info_string((CamelStoreSummary *)s, (const CamelStoreInfo *)i, CAMEL_IMAPX_STORE_INFO_FULL_NAME))
+ 
+ G_END_DECLS
+ 
+diff --git a/camel/providers/imapx/camel-imapx-store.c b/camel/providers/imapx/camel-imapx-store.c
+index efd7462..4ff9dc2 100644
+--- a/camel/providers/imapx/camel-imapx-store.c
++++ b/camel/providers/imapx/camel-imapx-store.c
+@@ -535,6 +535,11 @@ imapx_store_subscribe_folder (CamelStore *store, const gchar *folder_name, Camel
+ static void
+ imapx_store_unsubscribe_folder (CamelStore *store, const gchar *folder_name, CamelException *ex)
+ {
++	CamelException eex = CAMEL_EXCEPTION_INITIALISER;
++	
++	if (!ex)
++		ex = &eex;
++
+ 	imapx_unsubscribe_folder (store, folder_name, TRUE, ex);
+ }
+ 
+@@ -580,7 +585,19 @@ imapx_delete_folder_from_cache (CamelIMAPXStore *istore, const gchar *folder_nam
+ static void
+ imapx_delete_folder (CamelStore *store, const gchar *folder_name, CamelException *ex)
+ {
+-	camel_exception_setv(ex, 1, "delete_folder::unimplemented");
++	CamelIMAPXStore *istore = (CamelIMAPXStore *) store;
++
++	if (CAMEL_OFFLINE_STORE (store)->state == CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL) {
++		camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
++				     _("You must be working online to complete this operation"));
++		return;
++	}
++
++	if (istore->server && camel_imapx_server_connect (istore->server, 1))
++		camel_imapx_server_delete_folder (istore->server, folder_name, ex);
++
++	if (!camel_exception_is_set (ex))
++		imapx_delete_folder_from_cache (istore, folder_name, ex);
+ }
+ 
+ static void
+@@ -1006,12 +1023,32 @@ sync_folders (CamelIMAPXStore *istore, const gchar *pattern, CamelException *ex)
+ 	g_hash_table_destroy (folders_from_server);
+ }
+ 
++
++static void
++discover_inbox (CamelStore *store, CamelException *ex)
++{
++	CamelStoreInfo *si;
++	CamelIMAPXStore *istore = (CamelIMAPXStore *)store;
++	
++	si = camel_store_summary_path((CamelStoreSummary *) istore->summary, "INBOX");
++	if (si == NULL || (si->flags & CAMEL_FOLDER_SUBSCRIBED) == 0) {
++		imapx_subscribe_folder (store, "INBOX", FALSE, ex);
++		
++		if (!camel_exception_is_set(ex) && !si)
++			sync_folders (istore, "INBOX", ex);
++	
++		if (si)
++			camel_store_summary_info_free((CamelStoreSummary *) istore->summary, si);
++	}
++}
++
+ static CamelFolderInfo *
+ imapx_get_folder_info(CamelStore *store, const gchar *top, guint32 flags, CamelException *ex)
+ {
+ 	CamelIMAPXStore *istore = (CamelIMAPXStore *)store;
+ 	CamelFolderInfo * fi= NULL;
+ 	gboolean initial_setup = FALSE;
++	gchar *pattern;
+ 
+ 	if (top == NULL)
+ 		top = "";
+@@ -1027,24 +1064,32 @@ imapx_get_folder_info(CamelStore *store, const gchar *top, guint32 flags, CamelE
+ 	if (camel_store_summary_count ((CamelStoreSummary *) istore->summary) == 0)
+ 		initial_setup = TRUE;
+ 
+-	sync_folders (istore, top, ex);
++	if (*top) {
++		gchar *name;
++		gint i;
++
++		name = camel_imapx_store_summary_full_from_path(istore->summary, top);
++		if (name == NULL)
++			name = camel_imapx_store_summary_path_to_full(istore->summary, top, istore->dir_sep);
++
++		i = strlen(name);
++		pattern = g_alloca(i+5);
++		strcpy(pattern, name);
++		g_free(name);
++	} else {
++		pattern = g_alloca (1);
++		pattern[0] = '\0';
++	}
++
++	sync_folders (istore, pattern, ex);
++	if (camel_exception_is_set (ex))
++		return NULL;
++
+ 	camel_store_summary_save((CamelStoreSummary *) istore->summary);
+ 
+ 	/* ensure the INBOX is subscribed if lsub was preferred*/
+-	if (initial_setup && istore->rec_options & IMAPX_SUBSCRIPTIONS) {
+-		CamelStoreInfo *si;
+-		
+-		si = camel_store_summary_path((CamelStoreSummary *) istore->summary, "INBOX");
+-		if (si == NULL || (si->flags & CAMEL_FOLDER_SUBSCRIBED) == 0) {
+-			imapx_subscribe_folder (store, "INBOX", FALSE, ex);
+-			
+-			if (!camel_exception_is_set(ex) && !si)
+-				sync_folders (istore, "INBOX", ex);
+-		
+-			if (si)
+-				camel_store_summary_info_free((CamelStoreSummary *) istore->summary, si);
+-		}
+-	}
++	if (initial_setup && istore->rec_options & IMAPX_SUBSCRIPTIONS)
++		discover_inbox (store, ex);
+ 
+ 	fi = get_folder_info_offline (store, top, flags, ex);
+ 	return fi;
+diff --git a/camel/providers/imapx/camel-imapx-utils.c b/camel/providers/imapx/camel-imapx-utils.c
+index d93c0b3..939ab4b 100644
+--- a/camel/providers/imapx/camel-imapx-utils.c
++++ b/camel/providers/imapx/camel-imapx-utils.c
+@@ -475,7 +475,6 @@ imapx_parse_namespace_list (CamelIMAPXStream *stream, CamelException *ex)
+ 
+ 				node = g_new0 (CamelIMAPXStoreNamespace, 1);
+ 				node->next = NULL;
+-				node->full_name = g_strdup ((gchar *) token);
+ 				node->path = g_strdup ((gchar *) token);
+ 
+ 				tok = camel_imapx_stream_token (stream, &token, &len, ex);
+@@ -508,6 +507,10 @@ imapx_parse_namespace_list (CamelIMAPXStream *stream, CamelException *ex)
+ 				if (!g_ascii_strncasecmp (node->path, "INBOX", 5) &&
+ 						(node->path [6] == '\0' || node->path [6] == node->sep ))
+ 					memcpy (node->path, "INBOX", 5);
++				
++				/* TODO remove full_name later. not required */
++				node->full_name = g_strdup (node->path);
++
+ 				tok = camel_imapx_stream_token (stream, &token, &len, ex);
+ 				if (tok != ')') {
+ 					camel_exception_set (ex, 1, "namespace: expected a ')'");
+-- 
+1.7.0
+

Added: experimental/evolution-data-server/debian/patches/118-Bug-612401-IMAPX-cann-t-create-folder-in-top-hierarc.patch
URL: http://svn.debian.org/wsvn/pkg-evolution/experimental/evolution-data-server/debian/patches/118-Bug-612401-IMAPX-cann-t-create-folder-in-top-hierarc.patch?rev=1559&op=file
==============================================================================
--- experimental/evolution-data-server/debian/patches/118-Bug-612401-IMAPX-cann-t-create-folder-in-top-hierarc.patch (added)
+++ experimental/evolution-data-server/debian/patches/118-Bug-612401-IMAPX-cann-t-create-folder-in-top-hierarc.patch Thu Mar 11 07:55:31 2010
@@ -1,0 +1,42 @@
+From 2ef041c9f0d7976af7bd32fa158c90a84910ea67 Mon Sep 17 00:00:00 2001
+From: Chenthill Palanisamy <pchenthill at novell.com>
+Date: Wed, 10 Mar 2010 16:13:41 +0530
+Subject: [PATCH 18/21] Bug 612401 - IMAPX : cann't create folder in top hierarchy
+
+---
+ camel/providers/imapx/camel-imapx-store.c |    9 +++++----
+ 1 files changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/camel/providers/imapx/camel-imapx-store.c b/camel/providers/imapx/camel-imapx-store.c
+index 4ff9dc2..d80aea9 100644
+--- a/camel/providers/imapx/camel-imapx-store.c
++++ b/camel/providers/imapx/camel-imapx-store.c
+@@ -644,20 +644,21 @@ imapx_create_folder (CamelStore *store, const gchar *parent_name, const gchar *f
+ 	}
+ 	
+ 	parent_real = camel_imapx_store_summary_full_from_path(istore->summary, parent_name);
+-	si = camel_store_summary_path ((CamelStoreSummary *)istore->summary, parent_name);
+-	if (si == NULL || parent_real == NULL) {
++	if (parent_real == NULL) {
+ 		camel_exception_setv(ex, CAMEL_EXCEPTION_FOLDER_INVALID_STATE,
+ 				     _("Unknown parent folder: %s"), parent_name);
+ 		return NULL;
+ 	}
+ 
+-	if (si->flags & CAMEL_STORE_INFO_FOLDER_NOINFERIORS) {
++	si = camel_store_summary_path ((CamelStoreSummary *)istore->summary, parent_name);
++	if (si && si->flags & CAMEL_STORE_INFO_FOLDER_NOINFERIORS) {
+ 		camel_exception_set (ex, CAMEL_EXCEPTION_FOLDER_INVALID_STATE,
+ 				_("The parent folder is not allowed to contain subfolders"));
+ 		return NULL;
+ 	}
+ 
+-	camel_store_summary_info_free ((CamelStoreSummary *) istore->summary, si);
++	if (si)
++		camel_store_summary_info_free ((CamelStoreSummary *) istore->summary, si);
+ 
+ 	real_name = camel_imapx_store_summary_path_to_full (istore->summary, folder_name, dir_sep);
+ 	full_name = imapx_concat (istore, parent_real, real_name);
+-- 
+1.7.0
+

Added: experimental/evolution-data-server/debian/patches/119-Sync-changes-before-expunge.patch
URL: http://svn.debian.org/wsvn/pkg-evolution/experimental/evolution-data-server/debian/patches/119-Sync-changes-before-expunge.patch?rev=1559&op=file
==============================================================================
--- experimental/evolution-data-server/debian/patches/119-Sync-changes-before-expunge.patch (added)
+++ experimental/evolution-data-server/debian/patches/119-Sync-changes-before-expunge.patch Thu Mar 11 07:55:31 2010
@@ -1,0 +1,34 @@
+From 356875ae171de8567645f833d4c7798b7be47059 Mon Sep 17 00:00:00 2001
+From: Chenthill Palanisamy <pchenthill at novell.com>
+Date: Wed, 10 Mar 2010 17:07:52 +0530
+Subject: [PATCH 19/21] Sync changes before expunge
+
+---
+ camel/providers/imapx/camel-imapx-server.c |    4 +++-
+ 1 files changed, 3 insertions(+), 1 deletions(-)
+
+diff --git a/camel/providers/imapx/camel-imapx-server.c b/camel/providers/imapx/camel-imapx-server.c
+index 832c140..66de9e8 100644
+--- a/camel/providers/imapx/camel-imapx-server.c
++++ b/camel/providers/imapx/camel-imapx-server.c
+@@ -224,7 +224,7 @@ struct _CamelIMAPXJob {
+ 
+ 	gint noreply:1;		/* dont wait for reply */
+ 	guint32 type;		/* operation type */
+-	gchar pri;		/* the command priority */
++	guint32 pri;		/* the command priority */
+ 	short commands;		/* counts how many commands are outstanding */
+ 
+ 	CamelFolder *folder;
+@@ -3107,6 +3107,8 @@ imapx_job_expunge_start(CamelIMAPXServer *is, CamelIMAPXJob *job)
+ {
+ 	CamelIMAPXCommand *ic;
+ 
++	camel_imapx_server_sync_changes (is, job->folder, job->ex);
++
+ 	/* TODO handle UIDPLUS capability */
+ 	ic = camel_imapx_command_new("EXPUNGE", job->folder->full_name, "EXPUNGE");
+ 	ic->job = job;
+-- 
+1.7.0
+

Added: experimental/evolution-data-server/debian/patches/120-Strip-whitespace-off-strings-returned-from-e_contact.patch
URL: http://svn.debian.org/wsvn/pkg-evolution/experimental/evolution-data-server/debian/patches/120-Strip-whitespace-off-strings-returned-from-e_contact.patch?rev=1559&op=file
==============================================================================
--- experimental/evolution-data-server/debian/patches/120-Strip-whitespace-off-strings-returned-from-e_contact.patch (added)
+++ experimental/evolution-data-server/debian/patches/120-Strip-whitespace-off-strings-returned-from-e_contact.patch Thu Mar 11 07:55:31 2010
@@ -1,0 +1,85 @@
+From baa347bda65b0cf11b6d94e607ac0a864bbc78b4 Mon Sep 17 00:00:00 2001
+From: Matthew Barnes <mbarnes at redhat.com>
+Date: Wed, 10 Mar 2010 14:54:15 -0500
+Subject: [PATCH 20/21] Strip whitespace off strings returned from e_contact_get().
+
+Somewhat related to bug 554414 - Space in from or at end of email
+addresses prevents mails from being sent
+---
+ addressbook/libebook/e-contact.c |   16 ++++++++--------
+ 1 files changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/addressbook/libebook/e-contact.c b/addressbook/libebook/e-contact.c
+index 974c4c1..a42df15 100644
+--- a/addressbook/libebook/e-contact.c
++++ b/addressbook/libebook/e-contact.c
+@@ -1421,7 +1421,7 @@ e_contact_get (EContact *contact, EContactField field_id)
+ 			GList *list = g_list_copy (e_vcard_attribute_get_values (attr));
+ 			GList *l;
+ 			for (l = list; l; l = l->next)
+-				l->data = g_strdup (l->data);
++				l->data = g_strstrip (g_strdup (l->data));
+ 			return list;
+ 		}
+ 	}
+@@ -1435,7 +1435,7 @@ e_contact_get (EContact *contact, EContactField field_id)
+ 				v = e_vcard_attribute_get_values (attr);
+ 				v = g_list_nth (v, info->list_elem);
+ 
+-				return v ? g_strdup (v->data) : NULL;
++				return v ? g_strstrip (g_strdup (v->data)) : NULL;
+ 			}
+ 		}
+ 	}
+@@ -1456,7 +1456,7 @@ e_contact_get (EContact *contact, EContactField field_id)
+ 					if (num_left-- == 0) {
+ 						GList *v = e_vcard_attribute_get_values (attr);
+ 
+-						return v ? g_strdup (v->data) : NULL;
++						return v ? g_strstrip (g_strdup (v->data)) : NULL;
+ 					}
+ 				}
+ 			}
+@@ -1468,7 +1468,7 @@ e_contact_get (EContact *contact, EContactField field_id)
+ 		if (info->t & E_CONTACT_FIELD_TYPE_STRING) {
+ 			if (attr) {
+ 				GList *p = e_vcard_attribute_get_values (attr);
+-				return g_strdup (p->data);
++				return g_strstrip (g_strdup (p->data));
+ 			}
+ 			else {
+ 				return NULL;
+@@ -1494,7 +1494,7 @@ e_contact_get (EContact *contact, EContactField field_id)
+ 		if (info->t & E_CONTACT_FIELD_TYPE_STRUCT)
+ 			return (gpointer)info->boxed_type_getter();
+ 		else
+-			return g_strdup (rv);
++			return g_strstrip (g_strdup (rv));
+ 	}
+ 	else if (info->t & E_CONTACT_FIELD_TYPE_SYNTHETIC) {
+ 		switch (info->field_id) {
+@@ -1515,7 +1515,7 @@ e_contact_get (EContact *contact, EContactField field_id)
+ 					str = e_contact_get_const (contact, E_CONTACT_EMAIL_1);
+ 			}
+ 
+-			return g_strdup (str);
++			return g_strstrip (g_strdup (str));
+ 		}
+ 		case E_CONTACT_CATEGORIES: {
+ 			EVCardAttribute *attr = e_contact_get_first_attr (contact, EVC_CATEGORIES);
+@@ -1558,10 +1558,10 @@ e_contact_get (EContact *contact, EContactField field_id)
+ 				v = e_vcard_attribute_get_values (attr);
+ 
+ 				if (info->t & E_CONTACT_FIELD_TYPE_STRING) {
+-					return v ? g_strdup (v->data) : NULL;
++					return v ? g_strstrip (g_strdup (v->data)) : NULL;
+ 				}
+ 				else {
+-					rv = g_list_append (rv, v ? g_strdup (v->data) : NULL);
++					rv = g_list_append (rv, v ? g_strstrip (g_strdup (v->data)) : NULL);
+ 				}
+ 			}
+ 		}
+-- 
+1.7.0
+




More information about the pkg-evolution-commits mailing list