aboutsummaryrefslogtreecommitdiffstats
path: root/composer/e-msg-composer-attachment-bar.c
diff options
context:
space:
mode:
Diffstat (limited to 'composer/e-msg-composer-attachment-bar.c')
-rw-r--r--composer/e-msg-composer-attachment-bar.c58
1 files changed, 18 insertions, 40 deletions
diff --git a/composer/e-msg-composer-attachment-bar.c b/composer/e-msg-composer-attachment-bar.c
index ed79beb77d..5cb8ed0244 100644
--- a/composer/e-msg-composer-attachment-bar.c
+++ b/composer/e-msg-composer-attachment-bar.c
@@ -820,62 +820,40 @@ e_msg_composer_attachment_bar_attach_mime_part (EMsgComposerAttachmentBar *bar,
}
CamelMimePart *
-e_msg_composer_attachment_bar_find_content_id (EMsgComposerAttachmentBar *bar, char *content_id)
+e_msg_composer_attachment_bar_find_message (EMsgComposerAttachmentBar *bar, char *url)
{
EMsgComposerAttachmentBarPrivate *priv;
GList *p;
+ char *content_id = NULL;
g_return_val_if_fail (E_IS_MSG_COMPOSER_ATTACHMENT_BAR (bar), NULL);
- g_return_val_if_fail (content_id != NULL, NULL);
+ g_return_val_if_fail (url != NULL, NULL);
+ if (!strncmp ("cid:", url, 4))
+ content_id = url + 4;
+
priv = bar->priv;
for (p = priv->attachments; p != NULL; p = p->next) {
- EMsgComposerAttachment *attachment;
+ CamelMimePart *part;
const char *part_id;
-
- attachment = p->data;
- part_id = camel_mime_part_get_content_id (attachment->body);
-
- g_warning ("content_id: %s, part_id: %s\n", content_id, part_id);
- if (part_id && !strcmp (part_id, content_id))
- return attachment->body;
- }
+ const char *part_location;
- return NULL;
-}
+ part = E_MSG_COMPOSER_ATTACHMENT (p->data)->body;
-#if 0
-EMsgComposerAttachment *
-e_msg_composer_attachment_bar_find_content_id (EMsgComposerAttachmentBar *bar, char *content_id)
-{
- EMsgComposerAttachmentBarPrivate *priv;
- GList *p;
+ part_id = camel_mime_part_get_content_id (part);
+ g_warning ("content_id: %s, part_id: %s\n", content_id, part_id);
- g_return_val_if_fail (E_IS_MSG_COMPOSER_ATTACHMENT_BAR (bar), NULL);
- g_return_val_if_fail (content_id != NULL, NULL);
+ if (content_id && part_id && !strcmp (part_id, content_id))
+ return part;
- priv = bar->priv;
-
- if (priv->attachments)
- g_warning ("NO ATTACHMENTS");
-
- for (p = priv->attachments; p != NULL; p = p->next) {
- EMsgComposerAttachment *attachment;
- const char *part_id;
-
- attachment = p->data;
- part_id = camel_mime_part_get_content_id (attachment->body);
+ part_location = camel_mime_part_get_content_location (part);
+ g_warning ("url: %s, part_id: %s\n", url, part_id);
- g_warning ("content_id: %s, part_id: %s\n", content_id, part_id);
- if (part_id && !strcmp (part_id, content_id))
- return attachment;
+ if (part_id && !strcmp (part_location, url))
+ return part;
+
}
return NULL;
}
-#endif
-
-
-
-