"Unknown error");
}
- /* FIXME: parse for capabilities here. */
- d(fprintf (stderr, "%s\n", result));
-
+ /* parse for capabilities here. */
if (e_strstrcase (result, "IMAP4REV1"))
store->server_level = IMAP_LEVEL_IMAP4REV1;
else if (e_strstrcase (result, "IMAP4"))
store->has_status_capability = FALSE;
g_free (result);
-
+
/* We now need to find out which directory separator this daemon uses */
status = camel_imap_command_extended (store, NULL, &result, "LIST \"\" \"\"");
g_free (sep);
g_free (folder);
}
-
+
+ /* default directory separator */
+ if (!store->dir_sep)
+ store->dir_sep = g_strdup ("/");
+
g_free (result);
/* Lets add a timeout so that we can hopefully prevent getting disconnected */
CamelImapStore *store = CAMEL_IMAP_STORE (service);
char *result;
int status;
-
+
if (!service->connected)
return TRUE;
-
+
/* send the logout command */
status = camel_imap_command_extended (CAMEL_IMAP_STORE (service), NULL, &result, "LOGOUT");
if (status != CAMEL_IMAP_OK) {
if (!service_class->disconnect (service, ex))
return FALSE;
-
+
if (store->istream) {
gtk_object_unref (GTK_OBJECT (store->istream));
store->istream = NULL;
}
-
+
if (store->ostream) {
gtk_object_unref (GTK_OBJECT (store->ostream));
store->ostream = NULL;
}
-
+
g_free (store->dir_sep);
store->dir_sep = NULL;
-
+
store->current_folder = NULL;
-
+
if (store->timeout_id) {
gtk_timeout_remove (store->timeout_id);
store->timeout_id = 0;
camel_imap_store_get_toplevel_dir (CamelImapStore *store)
{
CamelURL *url = CAMEL_SERVICE (store)->url;
-
+
g_assert (url != NULL);
return url->path;
}
CamelURL *url = CAMEL_SERVICE (store)->url;
gchar *result, *folder_path, *dir_sep;
gint status;
-
+
dir_sep = CAMEL_IMAP_STORE (folder->parent_store)->dir_sep;
if (url && url->path && *(url->path + 1) && strcmp (folder->full_name, "INBOX"))
folder_path = g_strdup_printf ("%s%s%s", url->path + 1, dir_sep, folder->full_name);
else
folder_path = g_strdup (folder->full_name);
-
- d(fprintf (stderr, "doing an EXAMINE...\n"));
+
status = camel_imap_command_extended (CAMEL_IMAP_STORE (folder->parent_store), NULL,
&result, "EXAMINE %s", folder_path);
-
+
if (status != CAMEL_IMAP_OK) {
g_free (result);
g_free (folder_path);
}
g_free (folder_path);
g_free (result);
-
+
return TRUE;
}
CamelURL *url = CAMEL_SERVICE (store)->url;
gchar *result, *folder_path, *dir_sep;
gint status;
-
+
g_return_val_if_fail (folder != NULL, FALSE);
if (!(folder->full_name || folder->name)) {
"invalid folder path. Use set_name ?");
return FALSE;
}
-
+
if (!strcmp (folder->full_name, "INBOX"))
return TRUE;
-
+
if (imap_folder_exists (folder))
return TRUE;
status = camel_imap_command_extended (CAMEL_IMAP_STORE (folder->parent_store), NULL,
&result, "CREATE %s", folder_path);
-
+
if (status != CAMEL_IMAP_OK) {
CamelService *service = CAMEL_SERVICE (folder->parent_store);
camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
}
g_free (folder_path);
g_free (result);
-
+
return TRUE;
}
g_return_val_if_fail (folder_name != NULL, NULL);
dir_sep = CAMEL_IMAP_STORE (store)->dir_sep;
-
- if (dir_sep && !strcmp (folder_name, dir_sep))
+
+ /* if we're trying to get the top-level dir, we really want the namespace */
+ if (!strcmp (folder_name, dir_sep))
folder_path = g_strdup (url->path + 1);
else
folder_path = g_strdup (folder_name);
-
+
new_folder = camel_imap_folder_new (store, folder_path, ex);
-
+
+ /* this is the top-level dir, we already know it exists - it has to! */
if (!strcmp (folder_name, dir_sep))
return new_folder;
-
+
if (create && !imap_create (new_folder, ex)) {
if (!folder_is_selectable (store, folder_path)) {
camel_exception_clear (ex);