From b0ac33fbbe200997569e14574dd5aac746419bed Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Sun, 21 Oct 2001 19:08:07 +0000 Subject: Make inline images used for replies not show up as attachments. Also, I think this should make replies to HTML messages containing inline images referenced via Content-Location work, but that's not tested. * e-msg-composer.c (various): Keep two hash tables of inline image data: one mapping from cid: URLs to CamelMimeParts for all attachments, the other mapping from file: and Content-Location urls to CamelMimeParts (for those inline images that came from a file or have a Content-Location). (add_inlined_images): Simplify. Most of this code is in e_msg_composer_add_inline_image_from_file() now. (e_msg_composer_add_message_attachments, handle_multipart): Change "attach_all" arg to "just_inlines". If it is set, call e_msg_composer_add_inline_image_from_mime_part on any attachment with a Content-Id or Content-Location. (e_msg_composer_add_inline_image_from_file): Create a mime part from a file and add it to the inline images hash. (e_msg_composer_add_inline_image_from_mime_part): Add a mime part directly to the inline images hash. * listener.c (resolve_image_url): If asked to resolve a file: URL that isn't in the inline images hash, call e_msg_composer_add_inline_image_from_file to get a cid for it. (impl_event): Look up the URL in the inline_images and inline_images_by_url hashes. * e-msg-composer-attachment-bar.c (e_msg_composer_attachment_bar_find_message): Gone. No longer used. svn path=/trunk/; revision=13852 --- composer/e-msg-composer.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'composer/e-msg-composer.h') diff --git a/composer/e-msg-composer.h b/composer/e-msg-composer.h index 0153fe3ccf..72cb00a673 100644 --- a/composer/e-msg-composer.h +++ b/composer/e-msg-composer.h @@ -70,7 +70,7 @@ struct _EMsgComposer { Bonobo_PersistStream persist_stream_interface; GNOME_GtkHTML_Editor_Engine editor_engine; BonoboObject *editor_listener; - GHashTable *inline_images; + GHashTable *inline_images, *inline_images_by_url; Bonobo_ConfigDatabase config_db; @@ -122,6 +122,10 @@ void e_msg_composer_add_header (EMsgComposer *compose const char *value); void e_msg_composer_attach (EMsgComposer *composer, CamelMimePart *attachment); +CamelMimePart *e_msg_composer_add_inline_image_from_file (EMsgComposer *composer, + const char *filename); +void e_msg_composer_add_inline_image_from_mime_part (EMsgComposer *composer, + CamelMimePart *part); CamelMimeMessage *e_msg_composer_get_message (EMsgComposer *composer); CamelMimeMessage *e_msg_composer_get_message_draft (EMsgComposer *composer); void e_msg_composer_show_sig_file (EMsgComposer *composer); @@ -174,7 +178,7 @@ gchar * e_msg_composer_get_sig_file_content (const char *sigfi void e_msg_composer_add_message_attachments (EMsgComposer *composer, CamelMimeMessage *message, gboolean settext, - gboolean attach_all); + gboolean just_inlines); #ifdef __cplusplus } -- cgit v1.2.3