diff options
author | Jeffrey Stedfast <fejj@helixcode.com> | 2000-06-22 07:51:36 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2000-06-22 07:51:36 +0800 |
commit | 2751abfcef7d6a32b15948dd2801e216074d108f (patch) | |
tree | 3ba5435d5caa42f07ce258e85b822bb2a4aa2144 /camel/providers/imap/camel-imap-folder.c | |
parent | 930fe7cf7be0d15ad4329b82899af0fac75b9cc2 (diff) | |
download | gsoc2013-evolution-2751abfcef7d6a32b15948dd2801e216074d108f.tar gsoc2013-evolution-2751abfcef7d6a32b15948dd2801e216074d108f.tar.gz gsoc2013-evolution-2751abfcef7d6a32b15948dd2801e216074d108f.tar.bz2 gsoc2013-evolution-2751abfcef7d6a32b15948dd2801e216074d108f.tar.lz gsoc2013-evolution-2751abfcef7d6a32b15948dd2801e216074d108f.tar.xz gsoc2013-evolution-2751abfcef7d6a32b15948dd2801e216074d108f.tar.zst gsoc2013-evolution-2751abfcef7d6a32b15948dd2801e216074d108f.zip |
Modified to use the "namespace" (url->path) if it exists.
2000-06-21 Jeffrey Stedfast <fejj@helixcode.com>
* providers/imap/camel-imap-store.c (imap_create): Modified to
use the "namespace" (url->path) if it exists.
* providers/imap/camel-imap-folder.c (imap_delete_message_by_uid):
Now just sets the deleted flag on the summary rather than speaking
directly to the IMAP server. This is both faster and cleaner.
svn path=/trunk/; revision=3688
Diffstat (limited to 'camel/providers/imap/camel-imap-folder.c')
-rw-r--r-- | camel/providers/imap/camel-imap-folder.c | 36 |
1 files changed, 13 insertions, 23 deletions
diff --git a/camel/providers/imap/camel-imap-folder.c b/camel/providers/imap/camel-imap-folder.c index 649cf8d94e..c203e888fa 100644 --- a/camel/providers/imap/camel-imap-folder.c +++ b/camel/providers/imap/camel-imap-folder.c @@ -183,11 +183,11 @@ camel_imap_folder_get_type (void) } CamelFolder * -camel_imap_folder_new (CamelStore *parent, CamelException *ex) +camel_imap_folder_new (CamelStore *parent, const char *folder_name, CamelException *ex) { CamelFolder *folder = CAMEL_FOLDER (gtk_object_new (camel_imap_folder_get_type (), NULL)); - CF_CLASS (folder)->init (folder, parent, NULL, "INBOX", "/", FALSE, ex); + CF_CLASS (folder)->init (folder, parent, NULL, folder_name, "/", FALSE, ex); return folder; } @@ -311,11 +311,10 @@ imap_init (CamelFolder *folder, CamelStore *parent_store, CamelFolder *parent_fo static void imap_sync (CamelFolder *folder, gboolean expunge, CamelException *ex) { - /* TODO: actually code this method */ +#if 0 CamelImapFolder *imap_folder = CAMEL_IMAP_FOLDER (folder); gint i, max; -#if 0 /* uhhh...this is kinda unsafe so we'll leave it blocked out */ if (imap_folder->summary) { max = imap_folder->summary->len; @@ -663,7 +662,6 @@ imap_get_subfolder_names (CamelFolder *folder, CamelException *ex) /* parse out the subfolders */ listing = g_ptr_array_new (); - /*g_ptr_array_add (listing, g_strdup("INBOX"));*/ if (result) { char *ptr = result; @@ -710,40 +708,32 @@ imap_get_subfolder_names (CamelFolder *folder, CamelException *ex) static void imap_delete_message_by_uid (CamelFolder *folder, const gchar *uid, CamelException *ex) { - gchar *result; - gint status; - - status = camel_imap_command_extended (CAMEL_IMAP_STORE (folder->parent_store), folder, - &result, "UID STORE %s +FLAGS.SILENT (\\Deleted)", uid); + CamelMessageInfo *info; - if (status != CAMEL_IMAP_OK) { + if (!(info = (CamelMessageInfo *)imap_summary_get_by_uid (folder, uid))) { CamelService *service = CAMEL_SERVICE (folder->parent_store); camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE, - "Could not mark message %s as 'Deleted' on IMAP server %s: %s", - uid, service->url->host, - status == CAMEL_IMAP_ERR ? result : - "Unknown error"); - g_free (result); + "Could not set flags for message %s on IMAP server %s: %s", + uid, service->url->host, "Unknown error"); return; } - g_free (result); - return; + info->flags |= CAMEL_MESSAGE_DELETED | CAMEL_MESSAGE_FOLDER_FLAGGED; } static CamelMimeMessage * imap_get_message_by_uid (CamelFolder *folder, const gchar *uid, CamelException *ex) { CamelStream *msgstream; - CamelStreamFilter *f_stream; /* will be used later w/ crlf filter */ - CamelMimeFilter *filter; /* crlf/dot filter */ + /*CamelStreamFilter *f_stream;*/ + /*CamelMimeFilter *filter;*/ CamelMimeMessage *msg; - CamelMimePart *part; + /*CamelMimePart *part;*/ gchar *result, *header, *body, *mesg, *p; int id, status, part_len; - status = camel_imap_command_extended (CAMEL_STORE (folder->parent_store), folder, + status = camel_imap_command_extended (CAMEL_IMAP_STORE (folder->parent_store), folder, &result, "UID FETCH %s BODY.PEEK[HEADER]", uid); if (!result || status != CAMEL_IMAP_OK) { @@ -778,7 +768,7 @@ imap_get_message_by_uid (CamelFolder *folder, const gchar *uid, CamelException * g_free (result); printf ("*** We got the header ***\n"); - status = camel_imap_command_extended (CAMEL_STORE (folder->parent_store), folder, + status = camel_imap_command_extended (CAMEL_IMAP_STORE (folder->parent_store), folder, &result, "UID FETCH %s BODY[TEXT]", uid); if (!result || status != CAMEL_IMAP_OK) { |