Re: About folder subscriptions



Hi,

I found that camel does not automatically unsubscribe a folder when you
try to delete it with a call to camel_store_delete_folder. So I think
tinymail should do it in the default camel implementation
tny_camel_store_account_remove_folder_default.

This patch also initializes a CamelException. The lack of this
initialization made the method tny_camel_folder_get_headers crash when
the refresh parameter was TRUE.

Br.
Index: libtinymail-camel/tny-camel-folder.c
===================================================================
--- libtinymail-camel/tny-camel-folder.c	(revision 1225)
+++ libtinymail-camel/tny-camel-folder.c	(working copy)
@@ -830,7 +830,7 @@
 {
 	TnyCamelFolderPriv *priv = TNY_CAMEL_FOLDER_GET_PRIVATE (self);
 	GPtrArray *uids = NULL;
-	CamelException ex;
+	CamelException ex = CAMEL_EXCEPTION_INITIALISER;
 	FldAndPriv *ptr = NULL;
 
 	g_assert (TNY_IS_LIST (headers));
Index: libtinymail-camel/tny-camel-store-account.c
===================================================================
--- libtinymail-camel/tny-camel-store-account.c	(revision 1225)
+++ libtinymail-camel/tny-camel-store-account.c	(working copy)
@@ -326,6 +326,12 @@
 	{
 		if (cpriv->folder_name)
 		{
+			/* Unsubscribe : camel should do it by itself
+			   but it does not do it */
+			if (camel_store_supports_subscriptions (store) &&
+			    camel_store_folder_subscribed (store, cpriv->folder_name))
+				camel_store_unsubscribe_folder (store, cpriv->folder_name, NULL);
+
 			camel_store_delete_folder (store, cpriv->folder_name, &ex);
 			if (camel_exception_is_set (&ex))
 				g_critical ("Could not delete folder %s (%s)\n",


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