[evolution-patches] 63189. camel, imap folder deleting




fixed get_folder_info to actually return what you ask for.

--
Michael Zucchi <notzed ximian com>
"born to die, live to work, it's all downhill from here"
Novell's Evolution and Free Software Developer
? camel/19564.diff
? camel/README.debug
? camel/all.txt
? camel/buildtable
? camel/c.diff
? camel/camel-f.c
? camel/camel-service.2.c
? camel/camel-stream-ssl.c
? camel/camel-stream-ssl.h
? camel/camel-stream.0.html
? camel/camel-stream.1.html
? camel/camel-thread.h
? camel/cia.diff
? camel/cvf.c
? camel/diff
? camel/filter.diff
? camel/foo.c
? camel/g.diff
? camel/gpg.txt
? camel/imap.cplug
? camel/log
? camel/merged.msg
? camel/mt.diff
? camel/mylock
? camel/names.txt
? camel/new.c
? camel/old.c
? camel/out.ps
? camel/out.txt
? camel/outbox
? camel/plugin
? camel/plugin.c
? camel/plugin.txt
? camel/race.txt
? camel/search.txt
? camel/sig
? camel/test-from.c
? camel/test-ssl
? camel/test-ssl.c
? camel/test.c
? camel/trash.diff
? camel/typescript
? camel/vfolder.txt
? camel/vfolders.xml
? camel/devel-docs/camel-folder-summary.txt
? camel/providers/cache
? camel/providers/file
? camel/providers/g.diff
? camel/providers/imap/a.diff
? camel/providers/imap/callgraph.ps
? camel/providers/imap/camel-imap-command.c.00.rtl
? camel/providers/imap/camel-imap-folder.c.00.rtl
? camel/providers/imap/camel-imap-message-cache.c.00.rtl
? camel/providers/imap/camel-imap-provider.c.00.rtl
? camel/providers/imap/camel-imap-search.c.00.rtl
? camel/providers/imap/camel-imap-store-summary.c.00.rtl
? camel/providers/imap/camel-imap-store.c.00.rtl
? camel/providers/imap/camel-imap-summary.c.00.rtl
? camel/providers/imap/camel-imap-utils.c.00.rtl
? camel/providers/imap/camel-imap-wrapper.c.00.rtl
? camel/providers/imapp/camel-imapp-driver.c.00.rtl
? camel/providers/imapp/camel-imapp-engine.c.00.rtl
? camel/providers/imapp/camel-imapp-folder.c.00.rtl
? camel/providers/imapp/camel-imapp-part-stream.c
? camel/providers/imapp/camel-imapp-part-stream.h
? camel/providers/imapp/camel-imapp-provider.c.00.rtl
? camel/providers/imapp/camel-imapp-store-summary.c.00.rtl
? camel/providers/imapp/camel-imapp-store.c.00.rtl
? camel/providers/imapp/camel-imapp-stream.c.00.rtl
? camel/providers/imapp/camel-imapp-summary.c.00.rtl
? camel/providers/imapp/camel-imapp-utils.c.00.rtl
? camel/providers/imapp/cmc-imap.c
? camel/providers/imapp/cmc-session.c
? camel/providers/imapp/cmc-session.h
? camel/providers/imapp/imap-tokens.txt
? camel/providers/imapp/imapp-callgraph.ps
? camel/providers/imapp/imapp.txt
? camel/providers/imapp/test-2.c
? camel/providers/imapp/test-driver.c
? camel/providers/imapp/test-engine.c
? camel/providers/imapp/tok.c
? camel/providers/local/camel-mbox-provider.c
? camel/providers/local/cm.diff
? camel/providers/local/swummary.txt
? camel/providers/mbox/Makefile
? camel/providers/mbox/Makefile.in
? camel/providers/mbox/an
? camel/providers/mh/Makefile
? camel/providers/mh/Makefile.in
? camel/providers/pop3/camel-pop3-engine.c.00.rtl
? camel/providers/pop3/camel-pop3-folder.c.00.rtl
? camel/providers/pop3/camel-pop3-provider.c.00.rtl
? camel/providers/pop3/camel-pop3-store.c.00.rtl
? camel/providers/pop3/camel-pop3-stream.c.00.rtl
? camel/providers/vee/Makefile
? camel/providers/vee/Makefile.in
? camel/providers/vee/camel-vee-folder.c.save
? camel/providers/vee/camel-vee-folder.c.save2
? camel/providers/vee/diff
? camel/providers/vee/libcamelvee.urls
? camel/tests/a.out
? camel/tests/camel-mime-tests.tar.gz
? camel/tests/test.c
? camel/tests/data/addr.txt
? camel/tests/data/bg_BG.cp1251.windows-1251.txt
? camel/tests/data/ca.iso-8859-1.txt
? camel/tests/data/cs.ISO-8859-2.txt
? camel/tests/data/da.ISO-8859-1.txt
? camel/tests/data/de.ISO-8859-1.txt
? camel/tests/data/el.iso-8859-7.txt
? camel/tests/data/en_GB.iso-8859-1.txt
? camel/tests/data/es.iso-8859-1.txt
? camel/tests/data/et.iso-8859-1.txt
? camel/tests/data/eu.iso-8859-1.txt
? camel/tests/data/fi.iso-8859-15.txt
? camel/tests/data/fr.ISO-8859-1.txt
? camel/tests/data/ga.iso-8859-1.txt
? camel/tests/data/gl.iso-8859-1.txt
? camel/tests/data/hu.iso-8859-2.txt
? camel/tests/data/it.iso-8859-1.txt
? camel/tests/data/ja.euc-jp.txt
? camel/tests/data/ko.euc-kr.txt
? camel/tests/data/lt.iso-8859-13.txt
? camel/tests/data/messages
? camel/tests/data/nl.iso-8859-1.txt
? camel/tests/data/no.iso-8859-1.txt
? camel/tests/data/pl.iso-8859-2.txt
? camel/tests/data/pt.iso-8859-1.txt
? camel/tests/data/pt_BR.iso-8859-1.txt
? camel/tests/data/ru.koi8-r.txt
? camel/tests/data/sk.iso-8859-2.txt
? camel/tests/data/sl.iso-8859-2.txt
? camel/tests/data/sp.iso-8859-5.txt
? camel/tests/data/sr.iso-8859-2.txt
? camel/tests/data/sv.iso-8859-1.txt
? camel/tests/data/ta.TSCII.txt
? camel/tests/data/test-lines.h
? camel/tests/data/tr.iso-8859-9.txt
? camel/tests/data/uk.koi8-u.txt
? camel/tests/data/wa.iso-8859-1.txt
? camel/tests/data/zh_CN.GB2312.gb2312.txt
? camel/tests/data/zh_TW.Big5.big5.txt
? camel/tests/folder/trace
? camel/tests/message/t.diff
? camel/tests/message/test4
? camel/tests/message/uni.txt
? camel/tests/mime-filter/test-html.c
? camel/tests/misc/a
? camel/tests/misc/test1
? camel/tests/misc/test1.c
? camel/tests/misc/test2
? camel/tests/stream/readwrite.c
Index: camel/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/camel/ChangeLog,v
retrieving revision 1.2246
diff -u -3 -r1.2246 ChangeLog
--- camel/ChangeLog	21 Aug 2004 06:58:22 -0000	1.2246
+++ camel/ChangeLog	23 Aug 2004 07:41:15 -0000
@@ -1,3 +1,12 @@
+2004-08-23  Not Zed  <NotZed Ximian com>
+
+	** See bug #63189.
+
+	* providers/imap/camel-imap-store.c (get_subscribed_folders): only
+	LSUB folders we're interested in, and check full name of each path
+	element.
+	(imap_is_subfolder): helper for above.
+
 2004-08-21 Sivaiah Nallagatla <snallagatla novell com>
 	
 	* providers/groupwise/camel-gw-listener.c (account_changed) :
Index: camel/providers/imap/camel-imap-store.c
===================================================================
RCS file: /cvs/gnome/evolution/camel/providers/imap/camel-imap-store.c,v
retrieving revision 1.298
diff -u -3 -r1.298 camel-imap-store.c
--- camel/providers/imap/camel-imap-store.c	21 Jul 2004 15:55:00 -0000	1.298
+++ camel/providers/imap/camel-imap-store.c	23 Aug 2004 07:41:15 -0000
@@ -2435,12 +2435,36 @@
 	return fi;
 }
 
+/* returns true if full_name is a sub-folder of top, or is top */
+static int
+imap_is_subfolder(const char *full_name, const char *top)
+{
+	size_t len = strlen(top);
+
+	/* Looks for top being a full-path subset of full_name.
+	   Handle IMAP Inbox case insensitively */
+
+	if (g_ascii_strncasecmp(top, "inbox", 5) == 0
+	    && (top[5] == 0 || top[5] == '/')
+	    && g_ascii_strncasecmp(full_name, "inbox", 5) == 0
+	    && (full_name[5] == 0 || full_name[5] == '/')) {
+		full_name += 5;
+		top += 5;
+		len -= 5;
+	}
+
+	return top[0] == 0
+		|| (strncmp(full_name, top, len) == 0
+		    && (full_name[len] == 0
+			|| full_name[len] == '/'));
+}
+
 /* this is used when lsub doesn't provide very useful information */
 static GPtrArray *
 get_subscribed_folders (CamelImapStore *imap_store, const char *top, CamelException *ex)
 {
 	GPtrArray *names, *folders;
-	int i, toplen = strlen (top);
+	int i;
 	CamelStoreInfo *si;
 	CamelImapResponse *response;
 	CamelFolderInfo *fi;
@@ -2453,7 +2477,8 @@
 	folders = g_ptr_array_new ();
 	names = g_ptr_array_new ();
 	for (i=0;(si = camel_store_summary_index((CamelStoreSummary *)imap_store->summary, i));i++) {
-		if (si->flags & CAMEL_STORE_INFO_FOLDER_SUBSCRIBED) {
+		if (si->flags & CAMEL_STORE_INFO_FOLDER_SUBSCRIBED
+		    && imap_is_subfolder(camel_store_info_path(imap_store->summary, si), top)) {
 			g_ptr_array_add(names, (char *)camel_imap_store_info_full_name(imap_store->summary, si));
 			haveinbox = haveinbox || strcasecmp(camel_imap_store_info_full_name(imap_store->summary, si), "INBOX") == 0;
 		}
@@ -2482,8 +2507,8 @@
 		g_free (result);
 		if (!fi)
 			continue;
-		
-		if (strncmp (top, fi->full_name, toplen) != 0) {
+
+		if (!imap_is_subfolder(fi->full_name, top)) {
 			camel_folder_info_free (fi);
 			continue;
 		}


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