aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLarry Ewing <lewing@ximian.com>2001-10-05 12:09:41 +0800
committerLarry Ewing <lewing@src.gnome.org>2001-10-05 12:09:41 +0800
commit0f0efa5e7719eeedf3ca62eeddc87348e87747bf (patch)
tree52e8e03748cafd244820d2c97eb89dac0452d09f
parentbdc4787aef570378e11630f2248123b1c883f524 (diff)
downloadgsoc2013-evolution-0f0efa5e7719eeedf3ca62eeddc87348e87747bf.tar.gz
gsoc2013-evolution-0f0efa5e7719eeedf3ca62eeddc87348e87747bf.tar.zst
gsoc2013-evolution-0f0efa5e7719eeedf3ca62eeddc87348e87747bf.zip
look up an attachment by it's content id.
2001-10-04 Larry Ewing <lewing@ximian.com> * e-msg-composer-attachment-bar.c (e_msg_composer_attachment_bar_find_content_id): look up an attachment by it's content id. * e-msg-composer-attachment-bar.h: add prototype for e_msg_composer_attachment_bar_find_content_id. svn path=/trunk/; revision=13436
-rw-r--r--composer/ChangeLog9
-rw-r--r--composer/e-msg-composer-attachment-bar.c30
-rw-r--r--composer/e-msg-composer-attachment-bar.h2
3 files changed, 41 insertions, 0 deletions
diff --git a/composer/ChangeLog b/composer/ChangeLog
index ab94b1509d..b6d8046620 100644
--- a/composer/ChangeLog
+++ b/composer/ChangeLog
@@ -1,3 +1,12 @@
+2001-10-04 Larry Ewing <lewing@ximian.com>
+
+ * e-msg-composer-attachment-bar.c
+ (e_msg_composer_attachment_bar_find_content_id): look up an
+ attachment by it's content id.
+
+ * e-msg-composer-attachment-bar.h: add prototype for
+ e_msg_composer_attachment_bar_find_content_id.
+
2001-10-03 Jeffrey Stedfast <fejj@ximian.com>
* e-msg-composer.c (autosave_save_draft): Make sure to unref the
diff --git a/composer/e-msg-composer-attachment-bar.c b/composer/e-msg-composer-attachment-bar.c
index d5ae665af1..f5e90bf820 100644
--- a/composer/e-msg-composer-attachment-bar.c
+++ b/composer/e-msg-composer-attachment-bar.c
@@ -818,3 +818,33 @@ e_msg_composer_attachment_bar_attach_mime_part (EMsgComposerAttachmentBar *bar,
add_from_mime_part (bar, part);
}
+
+EMsgComposerAttachment *
+e_msg_composer_attachment_bar_find_content_id (EMsgComposerAttachmentBar *bar, char *content_id)
+{
+ EMsgComposerAttachmentBarPrivate *priv;
+ GList *p;
+
+ g_return_val_if_fail (E_IS_MSG_COMPOSER_ATTACHMENT_BAR (bar), NULL);
+ g_return_val_if_fail (content_id != NULL, NULL);
+
+ priv = bar->priv;
+
+ if (priv->attachments == NULL)
+ 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);
+
+ g_warning ("content_id: %s, part_id: %s\n", content_id, part_id);
+ if (part_id && !strcmp (part_id, content_id))
+ return attachment;
+ }
+
+ return NULL;
+}
+
diff --git a/composer/e-msg-composer-attachment-bar.h b/composer/e-msg-composer-attachment-bar.h
index 15774bb2fe..c68592e6e3 100644
--- a/composer/e-msg-composer-attachment-bar.h
+++ b/composer/e-msg-composer-attachment-bar.h
@@ -68,6 +68,8 @@ void e_msg_composer_attachment_bar_to_multipart (EMsgComposerAttachmentBar *bar,
guint e_msg_composer_attachment_bar_get_num_attachments (EMsgComposerAttachmentBar *bar);
void e_msg_composer_attachment_bar_attach (EMsgComposerAttachmentBar *bar, const gchar *file_name);
void e_msg_composer_attachment_bar_attach_mime_part (EMsgComposerAttachmentBar *bar, CamelMimePart *part);
+EMsgComposerAttachment *e_msg_composer_attachment_bar_find_content_id (EMsgComposerAttachmentBar *bar,
+ char *content_id);
#ifdef __cplusplus
}