diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2002-03-13 04:36:08 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2002-03-13 04:36:08 +0800 |
commit | e19514f1319263d57cb9ebf900513518b011c3b3 (patch) | |
tree | 858860a81a0dd69811d310a8a58ee48828db991d /camel | |
parent | 64980f67b06ced48f3d661acd90b5522338d5636 (diff) | |
download | gsoc2013-evolution-e19514f1319263d57cb9ebf900513518b011c3b3.tar.gz gsoc2013-evolution-e19514f1319263d57cb9ebf900513518b011c3b3.tar.zst gsoc2013-evolution-e19514f1319263d57cb9ebf900513518b011c3b3.zip |
Now takes a url argument.
2002-03-12 Jeffrey Stedfast <fejj@ximian.com>
* camel-digest-store.c (camel_digest_store_new): Now takes a url
argument.
* camel-digest-folder.c (digest_add_multipart): Fixed some memory
corruption and also modified to use CAMEL_IS_MIME_MESSAGE() rather
than comparing content-type strings.
(digest_get_message): Fixed a logic blooper.
* camel-folder-summary.c (camel_message_info_new_from_header): Set
the date fields of the CamelMessageInfo as well. This may even fix
some filter-related bugs where the user was trying to compare
dates.
svn path=/trunk/; revision=16126
Diffstat (limited to 'camel')
-rw-r--r-- | camel/ChangeLog | 15 | ||||
-rw-r--r-- | camel/camel-digest-folder.c | 40 | ||||
-rw-r--r-- | camel/camel-digest-store.c | 13 | ||||
-rw-r--r-- | camel/camel-digest-store.h | 2 | ||||
-rw-r--r-- | camel/camel-folder-summary.c | 8 | ||||
-rw-r--r-- | camel/camel-session.c | 2 |
6 files changed, 54 insertions, 26 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog index 46126857e0..febd54bee1 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,3 +1,18 @@ +2002-03-12 Jeffrey Stedfast <fejj@ximian.com> + + * camel-digest-store.c (camel_digest_store_new): Now takes a url + argument. + + * camel-digest-folder.c (digest_add_multipart): Fixed some memory + corruption and also modified to use CAMEL_IS_MIME_MESSAGE() rather + than comparing content-type strings. + (digest_get_message): Fixed a logic blooper. + + * camel-folder-summary.c (camel_message_info_new_from_header): Set + the date fields of the CamelMessageInfo as well. This may even fix + some filter-related bugs where the user was trying to compare + dates. + 2002-03-11 Jeffrey Stedfast <fejj@ximian.com> * camel-digest-store.c: A pretty empty store implementation to be diff --git a/camel/camel-digest-folder.c b/camel/camel-digest-folder.c index 41c0fbd4d5..a1f058e42d 100644 --- a/camel/camel-digest-folder.c +++ b/camel/camel-digest-folder.c @@ -160,7 +160,7 @@ multipart_contains_message_parts (CamelMultipart *multipart) wrapper = camel_medium_get_content_object (CAMEL_MEDIUM (part)); if (CAMEL_IS_MULTIPART (wrapper)) { has_message_parts = multipart_contains_message_parts (CAMEL_MULTIPART (wrapper)); - } else if (header_content_type_is (part->content_type, "message", "rfc822")) { + } else if (CAMEL_IS_MIME_MESSAGE (wrapper)) { has_message_parts = TRUE; } } @@ -179,8 +179,8 @@ camel_digest_folder_new (CamelStore *parent_store, CamelMimeMessage *message) if (!wrapper || !CAMEL_IS_MULTIPART (wrapper)) return NULL; + /* Make sure we have a multipart/digest subpart or at least some message/rfc822 attachments... */ if (!header_content_type_is (CAMEL_MIME_PART (message)->content_type, "multipart", "digest")) { - /* Make sure we have a multipart/digest subpart or at least some message/rfc822 attachments... */ if (!multipart_contains_message_parts (CAMEL_MULTIPART (wrapper))) return NULL; } @@ -215,37 +215,36 @@ digest_expunge (CamelFolder *folder, CamelException *ex) } static void -digest_add_multipart (CamelDigestFolder *digest, CamelMultipart *multipart, - GPtrArray *summary, GPtrArray *uids, GHashTable *info_hash, +digest_add_multipart (CamelMultipart *multipart, GPtrArray *summary, + GPtrArray *uids, GHashTable *info_hash, const char *preuid) { + CamelDataWrapper *wrapper; + CamelMessageInfo *info; + CamelMimePart *part; int parts, i; + char *uid; parts = camel_multipart_get_number (multipart); for (i = 0; i < parts; i++) { - CamelDataWrapper *wrapper; - CamelMessageInfo *info; - CamelMimePart *part; - char *uid; - part = camel_multipart_get_part (multipart, i); wrapper = camel_medium_get_content_object (CAMEL_MEDIUM (part)); if (CAMEL_IS_MULTIPART (wrapper)) { uid = g_strdup_printf ("%s%d.", preuid, i); - digest_add_multipart (digest, CAMEL_MULTIPART (wrapper), + digest_add_multipart (CAMEL_MULTIPART (wrapper), summary, uids, info_hash, uid); g_free (uid); continue; - } else if (!header_content_type_is (part->content_type, "message", "rfc822")) { + } else if (!CAMEL_IS_MIME_MESSAGE (wrapper)) { continue; } - info = camel_message_info_new_from_header (part->headers); + info = camel_message_info_new_from_header (CAMEL_MIME_PART (wrapper)->headers); uid = g_strdup_printf ("%s%d", preuid, i); - camel_message_info_set_uid (info, uid); + camel_message_info_set_uid (info, g_strdup (uid)); g_ptr_array_add (uids, uid); g_ptr_array_add (summary, info); @@ -270,7 +269,7 @@ digest_get_uids (CamelFolder *folder) info_hash = digest_folder->priv->info_hash; wrapper = camel_medium_get_content_object (CAMEL_MEDIUM (digest_folder->priv->message)); - digest_add_multipart (digest_folder, CAMEL_MULTIPART (wrapper), summary, uids, info_hash, ""); + digest_add_multipart (CAMEL_MULTIPART (wrapper), summary, uids, info_hash, ""); digest_folder->priv->uids = uids; digest_folder->priv->summary = summary; @@ -326,25 +325,26 @@ digest_get_message (CamelFolder *folder, const char *uid, CamelException *ex) CamelDataWrapper *wrapper; CamelMimeMessage *message; CamelMimePart *part; - char *subuid = ""; + char *subuid; int id; part = CAMEL_MIME_PART (digest->priv->message); + wrapper = camel_medium_get_content_object (CAMEL_MEDIUM (part)); do { id = strtoul (uid, &subuid, 10); - wrapper = camel_medium_get_content_object (CAMEL_MEDIUM (part)); if (!CAMEL_IS_MULTIPART (wrapper)) return NULL; part = camel_multipart_get_part (CAMEL_MULTIPART (wrapper), id); - uid = subuid++; - } while (*uid == '.'); + wrapper = camel_medium_get_content_object (CAMEL_MEDIUM (part)); + uid = subuid + 1; + } while (*subuid == '.'); - if (!CAMEL_IS_MIME_MESSAGE (part)) + if (!CAMEL_IS_MIME_MESSAGE (wrapper)) return NULL; - message = CAMEL_MIME_MESSAGE (part); + message = CAMEL_MIME_MESSAGE (wrapper); camel_object_ref (CAMEL_OBJECT (message)); return message; diff --git a/camel/camel-digest-store.c b/camel/camel-digest-store.c index b082ac0962..3e2833442d 100644 --- a/camel/camel-digest-store.c +++ b/camel/camel-digest-store.c @@ -105,15 +105,24 @@ camel_digest_store_finalise (CamelObject *obj) /** * camel_digest_store_new: + * @url: * * Create a new CamelDigestStore object. * * Return value: A new CamelDigestStore widget. **/ CamelStore * -camel_digest_store_new (void) +camel_digest_store_new (const char *url) { - CamelStore *store = CAMEL_STORE (camel_object_new (camel_digest_store_get_type ())); + CamelStore *store; + CamelURL *uri; + + uri = camel_url_new (url, NULL); + if (!uri) + return NULL; + + store = CAMEL_STORE (camel_object_new (camel_digest_store_get_type ())); + CAMEL_SERVICE (store)->url = uri; return store; } diff --git a/camel/camel-digest-store.h b/camel/camel-digest-store.h index 53f896e821..90e802f09f 100644 --- a/camel/camel-digest-store.h +++ b/camel/camel-digest-store.h @@ -50,7 +50,7 @@ struct _CamelDigestStoreClass { CamelType camel_digest_store_get_type (void); -CamelStore *camel_digest_store_new (void); +CamelStore *camel_digest_store_new (const char *url); #ifdef __cplusplus } diff --git a/camel/camel-folder-summary.c b/camel/camel-folder-summary.c index 89fdc3cb23..44ca09fb80 100644 --- a/camel/camel-folder-summary.c +++ b/camel/camel-folder-summary.c @@ -2447,7 +2447,7 @@ CamelMessageInfo * camel_message_info_new_from_header (struct _header_raw *header) { CamelMessageInfo *info; - char *subject, *from, *to, *cc, *mlist; + char *subject, *from, *to, *cc, *date, *mlist; struct _header_content_type *ct = NULL; const char *content, *charset = NULL; @@ -2463,6 +2463,7 @@ camel_message_info_new_from_header (struct _header_raw *header) from = summary_format_address(header, "from"); to = summary_format_address(header, "to"); cc = summary_format_address(header, "cc"); + date = header_raw_find (&header, "Date", NULL); mlist = header_raw_check_mailing_list(&header); if (ct) @@ -2475,7 +2476,10 @@ camel_message_info_new_from_header (struct _header_raw *header) camel_message_info_set_to(info, to); camel_message_info_set_cc(info, cc); camel_message_info_set_mlist(info, mlist); - + + info->date_sent = header_decode_date (date, NULL); + info->date_received = header_decode_date (date, NULL); + return info; } diff --git a/camel/camel-session.c b/camel/camel-session.c index 93e6feaf7c..e8240db509 100644 --- a/camel/camel-session.c +++ b/camel/camel-session.c @@ -69,7 +69,7 @@ static int session_thread_queue(CamelSession *session, CamelSessionThreadMsg *ms static void session_thread_wait(CamelSession *session, int id); #endif -/* The vfolder provider is always avilable */ +/* The vfolder provider is always available */ static CamelProvider vee_provider = { "vfolder", N_("Virtual folder email provider"), |