aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers/imap
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@helixcode.com>2000-06-21 01:34:18 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2000-06-21 01:34:18 +0800
commit98928d96630b95565e62cab807b19f5fdc96e41d (patch)
treee861b86b631e35002069b65753fc6009781a4823 /camel/providers/imap
parent8a77b2dfd8f25ef9c5a5b7a3a5231a65633599e0 (diff)
downloadgsoc2013-evolution-98928d96630b95565e62cab807b19f5fdc96e41d.tar
gsoc2013-evolution-98928d96630b95565e62cab807b19f5fdc96e41d.tar.gz
gsoc2013-evolution-98928d96630b95565e62cab807b19f5fdc96e41d.tar.bz2
gsoc2013-evolution-98928d96630b95565e62cab807b19f5fdc96e41d.tar.lz
gsoc2013-evolution-98928d96630b95565e62cab807b19f5fdc96e41d.tar.xz
gsoc2013-evolution-98928d96630b95565e62cab807b19f5fdc96e41d.tar.zst
gsoc2013-evolution-98928d96630b95565e62cab807b19f5fdc96e41d.zip
Now returns the last line of data that the server sends back as well. This
2000-06-20 Jeffrey Stedfast <fejj@helixcode.com> * providers/imap/camel-imap-store.c (camel_imap_command_extended): Now returns the last line of data that the server sends back as well. This is needed for commands like SELECT (like Peter pointed out). (camel_imap_command): No longer checks for SELECT (no need) * providers/imap/camel-imap-folder.c: Added namespace stuff which we will need later on... (imap_parse_subfolder_line): Convenience function for use in get_subfolder_names() (imap_get_subfolder_names): Updated. Also changed it to use LIST instead of LSUB (temporary change). svn path=/trunk/; revision=3646
Diffstat (limited to 'camel/providers/imap')
-rw-r--r--camel/providers/imap/camel-imap-folder.c2
-rw-r--r--camel/providers/imap/camel-imap-store.c35
2 files changed, 31 insertions, 6 deletions
diff --git a/camel/providers/imap/camel-imap-folder.c b/camel/providers/imap/camel-imap-folder.c
index 729a620820..0d67c2fa7f 100644
--- a/camel/providers/imap/camel-imap-folder.c
+++ b/camel/providers/imap/camel-imap-folder.c
@@ -282,6 +282,8 @@ imap_init (CamelFolder *folder, CamelStore *parent_store, CamelFolder *parent_fo
folder->full_name, service->url->host,
status == CAMEL_IMAP_ERR ? result :
"Unknown error");
+ } else {
+ /* parse the mode we opened it in */
}
g_free (result);
}
diff --git a/camel/providers/imap/camel-imap-store.c b/camel/providers/imap/camel-imap-store.c
index 76af3348e1..cf0789de93 100644
--- a/camel/providers/imap/camel-imap-store.c
+++ b/camel/providers/imap/camel-imap-store.c
@@ -331,10 +331,10 @@ imap_create (CamelFolder *folder, CamelException *ex)
return FALSE;
}
- if (!strcmp(folder->full_name, "INBOX"))
+ if (!strcmp (folder->full_name, "INBOX"))
return TRUE;
- if (camel_folder_get_subfolder(folder->parent_folder, folder->name, FALSE, ex))
+ if (camel_folder_get_subfolder (folder->parent_folder, folder->name, FALSE, ex))
return TRUE;
/* create the directory for the subfolder */
@@ -352,7 +352,7 @@ imap_create (CamelFolder *folder, CamelException *ex)
return FALSE;
}
- g_free(result);
+ g_free (result);
return TRUE;
}
@@ -423,8 +423,8 @@ camel_imap_command (CamelImapStore *store, CamelFolder *folder, char **ret, char
va_list ap;
gint status = CAMEL_IMAP_OK;
- if (folder && store->current_folder != folder && strncmp (fmt, "SELECT", 6) &&
- strncmp (fmt, "STATUS", 6) && strncmp (fmt, "CREATE", 5) && strcmp (fmt, "CAPABILITY")) {
+ if (folder && store->current_folder != folder && strncmp (fmt, "STATUS", 6) &&
+ strncmp (fmt, "CREATE", 5) && strcmp (fmt, "CAPABILITY")) {
/* We need to select the correct mailbox first */
char *r;
int s;
@@ -433,6 +433,24 @@ camel_imap_command (CamelImapStore *store, CamelFolder *folder, char **ret, char
if (s != CAMEL_IMAP_OK) {
*ret = r;
return s;
+ } else {
+ /* parse the read-write mode */
+#if 0
+ char *p;
+
+ p = strstr (result, "\n");
+ while (p) {
+ if (*(p + 1) == '*')
+ p = strstr (p, "\n");
+ else
+ break;
+ }
+
+ if (p) {
+ if (strstrcase (p, "READ-WRITE"))
+ mode =
+ }
+#endif
}
store->current_folder = folder;
@@ -565,7 +583,12 @@ camel_imap_command_extended (CamelImapStore *store, CamelFolder *folder, char **
g_ptr_array_add (data, respbuf);
}
- status = camel_imap_status (cmdid, respbuf);
+ if (respbuf) {
+ g_ptr_array_add (data, respbuf);
+ status = camel_imap_status (cmdid, respbuf);
+ } else {
+ status = CAMEL_IMAP_FAIL;
+ }
g_free (cmdid);
if (status == CAMEL_IMAP_OK) {