aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2004-06-10 11:31:04 +0800
committerMichael Zucci <zucchi@src.gnome.org>2004-06-10 11:31:04 +0800
commit7300480467a26360c6263afcb159a708d2dbca98 (patch)
treeba5e067d7d7ab6fbcb8094f47f5b9cb6442a3d61 /mail
parent51f081335faf0609b65e284a48d4b5513a72a04d (diff)
downloadgsoc2013-evolution-7300480467a26360c6263afcb159a708d2dbca98.tar
gsoc2013-evolution-7300480467a26360c6263afcb159a708d2dbca98.tar.gz
gsoc2013-evolution-7300480467a26360c6263afcb159a708d2dbca98.tar.bz2
gsoc2013-evolution-7300480467a26360c6263afcb159a708d2dbca98.tar.lz
gsoc2013-evolution-7300480467a26360c6263afcb159a708d2dbca98.tar.xz
gsoc2013-evolution-7300480467a26360c6263afcb159a708d2dbca98.tar.zst
gsoc2013-evolution-7300480467a26360c6263afcb159a708d2dbca98.zip
check that we have content selected, not just a selection, before trying
2004-06-10 Not Zed <NotZed@Ximian.com> * em-folder-view.c (emfv_message_reply): check that we have content selected, not just a selection, before trying to reply to that content. #59146. (emfv_message_reply): strip call content-* headers (fixme), and set transfer-encoding to 8bit. svn path=/trunk/; revision=26274
Diffstat (limited to 'mail')
-rw-r--r--mail/ChangeLog8
-rw-r--r--mail/em-folder-view.c44
2 files changed, 32 insertions, 20 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 3b0916e24d..100aeda7fe 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,11 @@
+2004-06-10 Not Zed <NotZed@Ximian.com>
+
+ * em-folder-view.c (emfv_message_reply): check that we have
+ content selected, not just a selection, before trying to reply to
+ that content. #59146.
+ (emfv_message_reply): strip call content-* headers (fixme), and
+ set transfer-encoding to 8bit.
+
2004-06-08 Rodney Dawes <dobey@ximian.com>
* mail-config.glade: Fix for SSL options appearing for sendmail
diff --git a/mail/em-folder-view.c b/mail/em-folder-view.c
index 34aad8ce52..1c13cacf76 100644
--- a/mail/em-folder-view.c
+++ b/mail/em-folder-view.c
@@ -1241,32 +1241,36 @@ emfv_message_reply(EMFolderView *emfv, int mode)
if (((EMFormatHTML *)emfv->preview)->html->engine->selection
&& ((EMFormatHTML *)emfv->preview)->html->engine->primary) {
/* && GTK_WIDGET_HAS_FOCUS(emfv->preview->formathtml.html)*/
- CamelMimeMessage *msg, *src;
- struct _camel_header_raw *header;
HTMLEngineSaveState *state;
- src = (CamelMimeMessage *)((EMFormat *)emfv->preview)->message;
- msg = camel_mime_message_new();
-
- header = ((CamelMimePart *)src)->headers;
- while (header) {
- /* FIXME: shouldn't we strip out *all* Content-* headers? */
- if (g_ascii_strcasecmp(header->name, "content-type") != 0)
- camel_medium_add_header((CamelMedium *)msg, header->name, header->value);
- header = header->next;
- }
-
state = html_engine_save_buffer_new(((EMFormatHTML *)emfv->preview)->html->engine, TRUE);
html_object_save(((EMFormatHTML *)emfv->preview)->html->engine->primary, state);
- camel_mime_part_set_content((CamelMimePart *)msg,
- ((GString *)state->user_data)->str,
- ((GString *)state->user_data)->len,
- "text/html");
+ if (state->user_data && ((GString *)state->user_data)->len) {
+ CamelMimeMessage *msg, *src;
+ struct _camel_header_raw *header;
+
+ src = (CamelMimeMessage *)((EMFormat *)emfv->preview)->message;
+ msg = camel_mime_message_new();
+
+ /* need to strip content- headers */
+ header = ((CamelMimePart *)src)->headers;
+ while (header) {
+ if (g_ascii_strncasecmp(header->name, "content-", 8) != 0)
+ camel_medium_add_header((CamelMedium *)msg, header->name, header->value);
+ header = header->next;
+ }
+ camel_mime_part_set_encoding((CamelMimePart *)msg, CAMEL_TRANSFER_ENCODING_8BIT);
+ camel_mime_part_set_content((CamelMimePart *)msg,
+ ((GString *)state->user_data)->str,
+ ((GString *)state->user_data)->len,
+ "text/html");
+ em_utils_reply_to_message (msg, mode);
+ camel_object_unref(msg);
+ } else {
+ em_utils_reply_to_message_by_uid (emfv->folder, emfv->list->cursor_uid, mode);
+ }
html_engine_save_buffer_free(state);
-
- em_utils_reply_to_message (msg, mode);
- camel_object_unref(msg);
} else {
em_utils_reply_to_message_by_uid (emfv->folder, emfv->list->cursor_uid, mode);
}