diff options
author | Jeffrey Stedfast <fejj@src.gnome.org> | 2000-05-31 01:41:31 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2000-05-31 01:41:31 +0800 |
commit | d6571004c072b3e4da27849c0de1b51d3e42eae4 (patch) | |
tree | 7d19089518d7175e96cfa368409e024130c4c217 /camel/providers/imap/camel-imap-store.c | |
parent | 7172355841dbd207938ae58879819c6935465803 (diff) | |
download | gsoc2013-evolution-d6571004c072b3e4da27849c0de1b51d3e42eae4.tar gsoc2013-evolution-d6571004c072b3e4da27849c0de1b51d3e42eae4.tar.gz gsoc2013-evolution-d6571004c072b3e4da27849c0de1b51d3e42eae4.tar.bz2 gsoc2013-evolution-d6571004c072b3e4da27849c0de1b51d3e42eae4.tar.lz gsoc2013-evolution-d6571004c072b3e4da27849c0de1b51d3e42eae4.tar.xz gsoc2013-evolution-d6571004c072b3e4da27849c0de1b51d3e42eae4.tar.zst gsoc2013-evolution-d6571004c072b3e4da27849c0de1b51d3e42eae4.zip |
Implemented a few more imap functions in providers/imap/camel-imap-folder.c
svn path=/trunk/; revision=3286
Diffstat (limited to 'camel/providers/imap/camel-imap-store.c')
-rw-r--r-- | camel/providers/imap/camel-imap-store.c | 36 |
1 files changed, 27 insertions, 9 deletions
diff --git a/camel/providers/imap/camel-imap-store.c b/camel/providers/imap/camel-imap-store.c index 0d35e971b2..2e6c2b3d9c 100644 --- a/camel/providers/imap/camel-imap-store.c +++ b/camel/providers/imap/camel-imap-store.c @@ -371,7 +371,7 @@ gint camel_imap_command (CamelImapStore *store, char **ret, char *fmt, ...) { gchar *cmdbuf, *respbuf; - gchar *cmdid; + gchar *cmdid, *code; va_list ap; gint status; @@ -401,15 +401,19 @@ camel_imap_command (CamelImapStore *store, char **ret, char *fmt, ...) return CAMEL_IMAP_FAIL; } - fprintf(stderr, "received: %s\n", respbuf); + fprintf(stderr, "received: %s\n", respbuf ? respbuf : "(null)"); - /* TODO: We should really check the command id, da? */ - if (!strncmp (respbuf + 11, "OK", 2)) - status = CAMEL_IMAP_OK; - else if (!strncmp (respbuf + 11, "NO", 2)) - status = CAMEL_IMAP_ERR; - else + if (respbuf) { + code = strstr(respbuf, cmdid) + strlen(cmdid) + 1; + if (!strncmp(code, "OK", 2)) + status = CAMEL_IMAP_OK; + else if (!strncmp(code, "NO", 2)) + status = CAMEL_IMAP_ERR; + else + status = CAMEL_IMAP_FAIL; + } else { status = CAMEL_IMAP_FAIL; + } if (ret) { if (status != CAMEL_IMAP_FAIL) { @@ -491,13 +495,15 @@ camel_imap_command_extended (CamelImapStore *store, char **ret, char *fmt, ...) } if (respbuf) { - code = respbuf + strlen(cmdid) + 1; + code = strstr(respbuf, cmdid) + strlen(cmdid) + 1; if (!strncmp(code, "OK", 2)) status = CAMEL_IMAP_OK; else if (!strncmp(code, "NO", 2)) status = CAMEL_IMAP_ERR; else status = CAMEL_IMAP_FAIL; + + g_free(respbuf); } else { status = CAMEL_IMAP_FAIL; } @@ -529,3 +535,15 @@ camel_imap_command_extended (CamelImapStore *store, char **ret, char *fmt, ...) + + + + + + + + + + + + |