aboutsummaryrefslogtreecommitdiffstats
path: root/camel
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@helixcode.com>2000-07-14 04:24:09 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2000-07-14 04:24:09 +0800
commit98c56f99098bcc023524e6f162ce4a216298f06a (patch)
treea773e4742f36d2b6e876d5c8e7e92b3bc442535d /camel
parent070653be4fc60e713e83239c1c5f9b660ee48555 (diff)
downloadgsoc2013-evolution-98c56f99098bcc023524e6f162ce4a216298f06a.tar
gsoc2013-evolution-98c56f99098bcc023524e6f162ce4a216298f06a.tar.gz
gsoc2013-evolution-98c56f99098bcc023524e6f162ce4a216298f06a.tar.bz2
gsoc2013-evolution-98c56f99098bcc023524e6f162ce4a216298f06a.tar.lz
gsoc2013-evolution-98c56f99098bcc023524e6f162ce4a216298f06a.tar.xz
gsoc2013-evolution-98c56f99098bcc023524e6f162ce4a216298f06a.tar.zst
gsoc2013-evolution-98c56f99098bcc023524e6f162ce4a216298f06a.zip
Updated to use CAMEL_IMAP_OK, CAMEL_IMAP_NO, CAMEL_IMAP_BAD, and
2000-07-13 Jeffrey Stedfast <fejj@helixcode.com> * providers/imap/camel-imap-folder.c: * providers/imap/camel-imap-store.c: Updated to use CAMEL_IMAP_OK, CAMEL_IMAP_NO, CAMEL_IMAP_BAD, and CAMEL_IMAP_FAIL rather than the ones copied from the POP3 provider. svn path=/trunk/; revision=4155
Diffstat (limited to 'camel')
-rw-r--r--camel/ChangeLog7
-rw-r--r--camel/providers/imap/camel-imap-folder.c22
-rw-r--r--camel/providers/imap/camel-imap-store.c15
-rw-r--r--camel/providers/imap/camel-imap-store.h2
4 files changed, 26 insertions, 20 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index a9b17bba72..1e299a6d47 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,5 +1,12 @@
2000-07-13 Jeffrey Stedfast <fejj@helixcode.com>
+ * providers/imap/camel-imap-folder.c:
+ * providers/imap/camel-imap-store.c: Updated to use CAMEL_IMAP_OK,
+ CAMEL_IMAP_NO, CAMEL_IMAP_BAD, and CAMEL_IMAP_FAIL rather than the
+ ones copied from the POP3 provider.
+
+2000-07-13 Jeffrey Stedfast <fejj@helixcode.com>
+
* providers/imap/camel-imap-folder.c (imap_get_summary): Oops.
If the number of messages in the folder is 0, don't fetch
summaries 1 thru 0, just return an empty summary.
diff --git a/camel/providers/imap/camel-imap-folder.c b/camel/providers/imap/camel-imap-folder.c
index d5a80dce81..8ba8c27f60 100644
--- a/camel/providers/imap/camel-imap-folder.c
+++ b/camel/providers/imap/camel-imap-folder.c
@@ -313,7 +313,7 @@ imap_sync (CamelFolder *folder, gboolean expunge, CamelException *ex)
"Could not set flags on message %s on IMAP "
"server %s: %s.", info->uid,
service->url->host,
- status == CAMEL_IMAP_ERR ? result :
+ status != CAMEL_IMAP_FAIL && result ? result :
"Unknown error");
g_free (result);
return;
@@ -347,7 +347,7 @@ imap_expunge (CamelFolder *folder, CamelException *ex)
camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
"Could not EXPUNGE from IMAP server %s: %s.",
service->url->host,
- status == CAMEL_IMAP_ERR && result ? result :
+ status != CAMEL_IMAP_FAIL && result ? result :
"Unknown error");
g_free (result);
return;
@@ -429,7 +429,7 @@ imap_get_message_count (CamelFolder *folder, CamelException *ex)
camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
"Could not get message count for %s from IMAP "
"server %s: %s.", folder_path, service->url->host,
- status == CAMEL_IMAP_ERR ? result :
+ status != CAMEL_IMAP_FAIL && result ? result :
"Unknown error");
g_free (result);
g_free (folder_path);
@@ -530,7 +530,7 @@ imap_append_message (CamelFolder *folder, CamelMimeMessage *message, guint32 fla
camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
"Could not APPEND message to IMAP server %s: %s.",
service->url->host,
- status == CAMEL_IMAP_ERR ? result :
+ status != CAMEL_IMAP_FAIL && result ? result :
"Unknown error");
g_free (result);
g_free (folder_path);
@@ -566,7 +566,7 @@ imap_copy_message_to (CamelFolder *source, const char *uid, CamelFolder *destina
camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
"Could not COPY message %s to %s on IMAP server %s: %s.",
uid, folder_path, service->url->host,
- status == CAMEL_IMAP_ERR ? result :
+ status != CAMEL_IMAP_FAIL && result ? result :
"Unknown error");
g_free (result);
g_free (folder_path);
@@ -602,7 +602,7 @@ imap_move_message_to (CamelFolder *source, const char *uid, CamelFolder *destina
camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
"Could not COPY message %s to %s on IMAP server %s: %s.",
uid, folder_path, service->url->host,
- status == CAMEL_IMAP_ERR ? result :
+ status != CAMEL_IMAP_FAIL && result ? result :
"Unknown error");
g_free (result);
g_free (folder_path);
@@ -720,7 +720,7 @@ imap_get_subfolder_names (CamelFolder *folder, CamelException *ex)
camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
"Could not get subfolder listing from IMAP "
"server %s: %s.", service->url->host,
- status == CAMEL_IMAP_ERR ? result :
+ status != CAMEL_IMAP_FAIL && result ? result :
"Unknown error");
g_free (result);
g_free (folder_path);
@@ -813,7 +813,7 @@ imap_get_message (CamelFolder *folder, const gchar *uid, CamelException *ex)
camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
"Could not fetch message %s on IMAP server %s: %s",
uid, service->url->host,
- status == CAMEL_IMAP_ERR ? result :
+ status != CAMEL_IMAP_FAIL && result ? result :
"Unknown error");
g_free (result);
return camel_mime_message_new ();
@@ -854,7 +854,7 @@ imap_get_message (CamelFolder *folder, const gchar *uid, CamelException *ex)
camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
"Could not fetch message %s on IMAP server %s: %s",
uid, service->url->host,
- status == CAMEL_IMAP_ERR ? result :
+ status != CAMEL_IMAP_FAIL && result ? result :
"Unknown error");
g_free (result);
g_free (header);
@@ -1055,7 +1055,7 @@ imap_get_summary (CamelFolder *folder, CamelException *ex)
camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
"Could not get summary for %s on IMAP server %s: %s",
folder->full_name, service->url->host,
- status == CAMEL_IMAP_ERR ? result :
+ status != CAMEL_IMAP_FAIL && result ? result :
"Unknown error");
g_free (result);
@@ -1368,7 +1368,7 @@ imap_search_by_expression (CamelFolder *folder, const char *expression, CamelExc
camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
"Could not get summary for %s on IMAP server %s: %s",
folder->full_name, service->url->host,
- status == CAMEL_IMAP_ERR ? result :
+ status != CAMEL_IMAP_FAIL && result ? result :
"Unknown error");
g_free (result);
return NULL;
diff --git a/camel/providers/imap/camel-imap-store.c b/camel/providers/imap/camel-imap-store.c
index 2fdbe5545a..717c407b58 100644
--- a/camel/providers/imap/camel-imap-store.c
+++ b/camel/providers/imap/camel-imap-store.c
@@ -111,7 +111,7 @@ camel_imap_store_get_type (void)
{
static GtkType camel_imap_store_type = 0;
- if (!camel_imap_store_type) {
+ if (!camel_imap_store_type) {
GtkTypeInfo camel_imap_store_info =
{
"CamelImapStore",
@@ -123,7 +123,7 @@ camel_imap_store_get_type (void)
/* reserved_2 */ NULL,
(GtkClassInitFunc) NULL,
};
-
+
camel_imap_store_type = gtk_type_unique (CAMEL_STORE_TYPE, &camel_imap_store_info);
}
@@ -332,7 +332,7 @@ imap_connect (CamelService *service, CamelException *ex)
camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
"Could not get capabilities on IMAP server %s: %s.",
service->url->host,
- status == CAMEL_IMAP_ERR ? result :
+ status != CAMEL_IMAP_FAIL && result ? result :
"Unknown error");
}
@@ -442,7 +442,7 @@ imap_create (CamelFolder *folder, CamelException *ex)
camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
"Could not CREATE %s on IMAP server %s: %s.",
folder_path, service->url->host,
- status == CAMEL_IMAP_ERR ? result :
+ status != CAMEL_IMAP_FAIL && result ? result :
"Unknown error");
g_free (result);
g_free (folder_path);
@@ -496,7 +496,9 @@ camel_imap_status (char *cmdid, char *respbuf)
if (!strncmp (retcode, "OK", 2))
return CAMEL_IMAP_OK;
else if (!strncmp (retcode, "NO", 2))
- return CAMEL_IMAP_ERR;
+ return CAMEL_IMAP_NO;
+ else if (!strncmp (retcode, "BAD", 3))
+ return CAMEL_IMAP_BAD;
}
}
@@ -532,9 +534,6 @@ camel_imap_command (CamelImapStore *store, CamelFolder *folder, char **ret, char
va_list ap;
gint status = CAMEL_IMAP_OK;
- if (folder)
- printf ("*** Current folder = %s\n", store->current_folder->full_name);
-
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 */
diff --git a/camel/providers/imap/camel-imap-store.h b/camel/providers/imap/camel-imap-store.h
index d0ec78bf44..09dd2be148 100644
--- a/camel/providers/imap/camel-imap-store.h
+++ b/camel/providers/imap/camel-imap-store.h
@@ -66,7 +66,7 @@ void camel_imap_store_close (CamelImapStore *store, gboolean expunge, CamelExcep
/* support functions */
-enum { CAMEL_IMAP_OK, CAMEL_IMAP_ERR, CAMEL_IMAP_FAIL };
+enum { CAMEL_IMAP_OK, CAMEL_IMAP_NO, CAMEL_IMAP_BAD, CAMEL_IMAP_FAIL };
gint camel_imap_command (CamelImapStore *store, CamelFolder *folder, char **ret, char *fmt, ...);
gint camel_imap_command_extended (CamelImapStore *store, CamelFolder *folder, char **ret, char *fmt, ...);