summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2001-04-01 21:17:50 +0000
committerJeffrey Stedfast <fejj@src.gnome.org>2001-04-01 21:17:50 +0000
commit69224c208540d374b66f57c083f5279ffb5ca70a (patch)
treeba81c77dbb1a92db3a0c1b8eb77a719f9c79a512
parentbc7d2f4901021c7e207a8dbef48bf9cec1ea8ef3 (diff)
downloadevolution-data-server-69224c208540d374b66f57c083f5279ffb5ca70a.tar.gz
Don't blindly append "/INBOX", construct a CamelURL and set the path that
2001-04-01 Jeffrey Stedfast <fejj@ximian.com> * providers/imap/camel-imap-store.c (get_folder_info): Don't blindly append "/INBOX", construct a CamelURL and set the path that way. (parse_list_response_as_folder_info): Don't blindly append "/<foldername>", construct a CamelURL and set the path that way instead. (get_folders_offline): And again here.
-rw-r--r--camel/ChangeLog14
-rw-r--r--camel/providers/imap/camel-imap-store.c38
2 files changed, 44 insertions, 8 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index 232e84712..9e4e38373 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,9 +1,19 @@
+2001-04-01 Jeffrey Stedfast <fejj@ximian.com>
+
+ * providers/imap/camel-imap-store.c (get_folder_info): Don't
+ blindly append "/INBOX", construct a CamelURL and set the path
+ that way.
+ (parse_list_response_as_folder_info): Don't blindly append
+ "/<foldername>", construct a CamelURL and set the path that way
+ instead.
+ (get_folders_offline): And again here.
+
2001-03-31 Not Zed <NotZed@Ximian.com>
* camel-operation.c (struct _status_stack): change stamp to
unsigned to avoid overflow.
- (camel_operation_end):
- (camel_operation_progress_count):
+ (camel_operation_end):
+ (camel_operation_progress_count):
(camel_operation_progress): Double the delay before transient
events start showing their own progress.
diff --git a/camel/providers/imap/camel-imap-store.c b/camel/providers/imap/camel-imap-store.c
index daa987153..8a88d4783 100644
--- a/camel/providers/imap/camel-imap-store.c
+++ b/camel/providers/imap/camel-imap-store.c
@@ -943,8 +943,15 @@ parse_list_response_as_folder_info (CamelImapStore *imap_store,
fi->name = g_strdup (name);
else
fi->name = g_strdup (dir);
- if (!(flags & IMAP_LIST_FLAG_NOSELECT))
- fi->url = g_strdup_printf ("%s/%s", imap_store->base_url, dir);
+ if (!(flags & IMAP_LIST_FLAG_NOSELECT)) {
+ CamelURL *url;
+
+ url = camel_url_new (imap_store->base_url, NULL);
+ g_free (url->path);
+ url->path = g_strdup_printf ("/%s", dir);
+ fi->url = camel_url_to_string (url, 0);
+ camel_url_free (url);
+ }
if (!(flags & IMAP_LIST_FLAG_UNMARKED))
fi->unread_message_count = -1;
@@ -1067,11 +1074,15 @@ get_folders_offline (CamelImapStore *imap_store, GPtrArray *folders,
CamelException *ex)
{
CamelFolderInfo *fi;
+ CamelURL *url;
int i;
i = folders->len;
g_hash_table_foreach (imap_store->subscribed_folders,
add_folder, folders);
+
+ url = camel_url_new (imap_store->base_url, NULL);
+
while (i < folders->len) {
fi = g_new0 (CamelFolderInfo, 1);
fi->full_name = g_strdup (folders->pdata[i]);
@@ -1080,11 +1091,16 @@ get_folders_offline (CamelImapStore *imap_store, GPtrArray *folders,
fi->name = g_strdup (fi->name + 1);
else
fi->name = g_strdup (fi->full_name);
- fi->url = g_strdup_printf ("%s/%s", imap_store->base_url,
- fi->full_name);
+
+ g_free (url->path);
+ url->path = g_strdup_printf ("/%s", fi->full_name);
+ fi->url = camel_url_to_string (url, 0);
+
fi->unread_message_count = -1;
folders->pdata[i++] = fi;
}
+
+ camel_url_free (url);
}
static void
@@ -1172,13 +1188,23 @@ get_folder_info (CamelStore *store, const char *top, gboolean fast,
}
}
}
+
if (need_inbox) {
+ CamelURL *url;
+ char *uri;
+
+ url = camel_url_new (imap_store->base_url, NULL);
+ g_free (url->path);
+ url->path = g_strdup ("/INBOX");
+ uri = camel_url_to_string (url, 0);
+ camel_url_free (url);
+
fi = g_new0 (CamelFolderInfo, 1);
fi->full_name = g_strdup ("INBOX");
fi->name = g_strdup ("INBOX");
- fi->url = g_strdup_printf ("%s/INBOX", imap_store->base_url);
+ fi->url = uri;
fi->unread_message_count = -1;
-
+
g_ptr_array_add (folders, fi);
}