Tweak how we build the tree based on whether a full tree or a subtree is

2002-08-09  Peter Williams  <peterw@ximian.com>

	* providers/imap/camel-imap-store.c
	(get_folder_info_online): Tweak how we build the tree based on whether
	a full tree or a subtree is being requested. Fixes subscribe dialog
	on UW servers.
	(get_one_folder_offline): Don't add folders that we're not subscribed
	to; fixes UW folders that weren't being marked as NoSelect because
	the storeinfo doesn't record that information.

svn path=/trunk/; revision=17755
This commit is contained in:
Peter Williams
2002-08-09 19:37:31 +00:00
committed by Peter Williams
parent d6c5e8db0d
commit 56ddb4490b
2 changed files with 31 additions and 1 deletions

View File

@ -1,3 +1,13 @@
2002-08-09 Peter Williams <peterw@ximian.com>
* providers/imap/camel-imap-store.c
(get_folder_info_online): Tweak how we build the tree based on whether
a full tree or a subtree is being requested. Fixes subscribe dialog
on UW servers.
(get_one_folder_offline): Don't add folders that we're not subscribed
to; fixes UW folders that weren't being marked as NoSelect because
the storeinfo doesn't record that information.
2002-08-09 Peter Williams <peterw@ximian.com>
* providers/imap/camel-imap-folder.c (imap_rename): When renaming our

View File

@ -2098,7 +2098,18 @@ get_folder_info_online (CamelStore *store, const char *top,
}
/* Assemble. */
tree = camel_folder_info_build (folders, name, imap_store->dir_sep, TRUE);
/* if building the folder tree, preserve the namespace at the top. Note the
* ==, not strcmp. This makes it so that the subscribe dialog and the folder
* tree have the same layout and prevents the subscribe dialog from building
* infinitely large trees.
*/
if (name == imap_store->namespace)
tree = camel_folder_info_build (folders, "", imap_store->dir_sep, TRUE);
else
tree = camel_folder_info_build (folders, name, imap_store->dir_sep, TRUE);
if (flags & CAMEL_STORE_FOLDER_INFO_FAST) {
g_ptr_array_free (folders, TRUE);
return tree;
@ -2167,6 +2178,15 @@ get_one_folder_offline (const char *physical_path, const char *path, gpointer da
if (*path != '/')
return TRUE;
/* folder_info_build will insert parent nodes as necessary and mark
* them as noselect, which is information we actually don't have at
* the moment. So let it do the right thing by bailing out if it's
* not a folder we're explicitly interested in.
*/
if (g_hash_table_lookup (imap_store->subscribed_folders, path + 1) == 0)
return TRUE;
fi = g_new0 (CamelFolderInfo, 1);
fi->full_name = g_strdup (path+1);
fi->name = strrchr (fi->full_name, imap_store->dir_sep);