This commit implements a new handling of image attachments. We follow
authorJose Dapena Paz <jdapena@igalia.com>
Fri, 28 Sep 2007 14:54:55 +0000 (14:54 +0000)
committerJose Dapena Paz <jdapena@igalia.com>
Fri, 28 Sep 2007 14:54:55 +0000 (14:54 +0000)
commitb9b928dee5f5169c3317df86b153b4d069b814d0
treec8452b8dc9398cd8369e9f63166eecb7dcea28ca
parentc5e2714e23c9d314a57b3e5769286f9014fb8d82
This commit implements a new handling of image attachments. We follow
the standard of mime, adding the image attachment in a multipart/related
with the body. These together form the complete body of the message.
This fixes NB#64463.
* src/widgets/modest-msg-edit-window.h:
        * Add attribute images to the MsgData.
* src/widgets/modest-attachments-view.c:
        * We only add attachments from message if it's not a
          multipart/related (as they would be attached images and they
          shouldn't be represented in attachments view).
* src/modest-tny-msg.[ch]:
        * (modest_formatter_create_message): now it accepts a new
          parameter "has_images", to create the proper structure of
          image attachments (including the multipart/related).
        * /modest_tny_msg_new_html_plain): now it receives also a
          list of image mime parts. It adds them properly to the
          message using the new add_images() method.
        * (add_attachment). Now it allows adding attachments as children
          of an arbitrary part. This is required to add image
          attachments to multipart/related. It also accepts a new
          parameter "add_inline" to set the disposition as attachment or
          inline depending on the parameter used.
        * (add_images): this new method searches the multipart/related
          mime part, and adds a list of image mime parts to it.
* src/modest-ui-actions.c:
        * Add images parameter to save to drafts and send new mail
          actions.
* src/maemo/modest-msg-edit-window.c:
        * Now we maintain an internal list of images in body buffer,
          separated from the list of attachments.
        * (replace_with_attachments): renamed to replace_with_images
          as it's intended to replace image replacers with attached
          images in priv->images list.
        * New method (get_related_images): searches the
          multipart/related mime part, and obtains all the image
          children it has. Then it adds the images to the priv->images
          list.
        * Now last_cid is updated using the images and attachments list.
        * (modest_msg_edit_window_get_msg_data): now we also obtain the
          list of images attached (unless a image is in priv->image and
          not refernced in the buffer).
* src/modest-formatter.[ch]:
        * Added internal method find_body_parent (), to refactor the
          work to find the part where body should be attached to.
        * (modest_formatter_create_message): now it takes into account
          the new attribute has_images to create the proper mime part
          multipart/related.
* src/modest-mail-operation.[ch]:
        * (modest_mail_operation_create_message): now we pass the images
          list to the lower layers.

pmo-trunk-r3438
src/maemo/modest-msg-edit-window.c
src/modest-formatter.c
src/modest-formatter.h
src/modest-mail-operation.c
src/modest-mail-operation.h
src/modest-tny-msg.c
src/modest-tny-msg.h
src/modest-ui-actions.c
src/widgets/modest-attachments-view.c
src/widgets/modest-msg-edit-window.h