aboutsummaryrefslogtreecommitdiffstats
path: root/mail/folder-browser.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2003-07-04 02:36:51 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2003-07-04 02:36:51 +0800
commita6f0914f29a46e353a17e36d0cb4f85424f58f3f (patch)
tree89e06a2007edde1781817076c546aa33e4197ffc /mail/folder-browser.c
parent994243e216d8349af1a416e9222f4f66f4c45b12 (diff)
downloadgsoc2013-evolution-a6f0914f29a46e353a17e36d0cb4f85424f58f3f.tar
gsoc2013-evolution-a6f0914f29a46e353a17e36d0cb4f85424f58f3f.tar.gz
gsoc2013-evolution-a6f0914f29a46e353a17e36d0cb4f85424f58f3f.tar.bz2
gsoc2013-evolution-a6f0914f29a46e353a17e36d0cb4f85424f58f3f.tar.lz
gsoc2013-evolution-a6f0914f29a46e353a17e36d0cb4f85424f58f3f.tar.xz
gsoc2013-evolution-a6f0914f29a46e353a17e36d0cb4f85424f58f3f.tar.zst
gsoc2013-evolution-a6f0914f29a46e353a17e36d0cb4f85424f58f3f.zip
Strip the signature from the body text. Fixes bug #45523. While we're
2003-07-02 Jeffrey Stedfast <fejj@ximian.com> * mail-tools.c (mail_tool_forward_message): Strip the signature from the body text. Fixes bug #45523. While we're here, also fix the code to quote exactly the same way as the mail_tool_quote_message() function. (mail_tool_quote_message): The last arg should not be 'want_plain', because that arg is for whether or not the body should be quoted. * folder-browser.c (message_list_drag_data_get): Apply a From-filter when dragging as a test/uri-list and message/rfc822. Fixes bug #45617. Also free the uids ptrarray for the text/uri-list case. svn path=/trunk/; revision=21739
Diffstat (limited to 'mail/folder-browser.c')
-rw-r--r--mail/folder-browser.c46
1 files changed, 30 insertions, 16 deletions
diff --git a/mail/folder-browser.c b/mail/folder-browser.c
index b2b9f2f2f3..e28ff18431 100644
--- a/mail/folder-browser.c
+++ b/mail/folder-browser.c
@@ -317,6 +317,8 @@ message_list_drag_data_get (ETree *tree, int row, ETreePath path, int col,
{
const char *filename, *tmpdir;
CamelMimeMessage *message;
+ CamelMimeFilter *filter;
+ CamelStream *fstream;
CamelStream *stream;
char *uri_list;
int fd;
@@ -351,7 +353,7 @@ message_list_drag_data_get (ETree *tree, int row, ETreePath path, int col,
fd = open (uri_list + 7, O_WRONLY | O_CREAT | O_EXCL, 0600);
if (fd == -1) {
/* cleanup and abort */
- camel_object_unref (CAMEL_OBJECT (message));
+ camel_object_unref (message);
for (i = 1; i < uids->len; i++)
g_free (uids->pdata[i]);
g_ptr_array_free (uids, TRUE);
@@ -359,20 +361,28 @@ message_list_drag_data_get (ETree *tree, int row, ETreePath path, int col,
return;
}
- stream = camel_stream_fs_new_with_fd (fd);
+ fstream = camel_stream_fs_new_with_fd (fd);
- camel_stream_write (stream, "From - \n", 8);
+ stream = camel_stream_filter_new_with_stream (fstream);
+ filter = camel_mime_filter_from_new ();
+ camel_stream_filter_add (CAMEL_STREAM_FILTER (stream), filter);
+ camel_object_unref (filter);
+
+ camel_stream_write (fstream, "From - \n", 8);
camel_data_wrapper_write_to_stream (CAMEL_DATA_WRAPPER (message), stream);
- camel_object_unref (CAMEL_OBJECT (message));
+ camel_object_unref (message);
for (i = 1; i < uids->len; i++) {
message = camel_folder_get_message (fb->folder, uids->pdata[i], NULL);
- camel_stream_write (stream, "From - \n", 8);
+ camel_stream_write (fstream, "From - \n", 8);
camel_data_wrapper_write_to_stream (CAMEL_DATA_WRAPPER (message), stream);
- camel_object_unref (CAMEL_OBJECT (message));
+ camel_object_unref (message);
g_free (uids->pdata[i]);
}
- camel_object_unref (CAMEL_OBJECT (stream));
+ g_ptr_array_free (uids, TRUE);
+
+ camel_object_unref (stream);
+ camel_object_unref (fstream);
gtk_selection_data_set (selection_data, selection_data->target, 8,
uri_list, strlen (uri_list));
@@ -381,13 +391,16 @@ message_list_drag_data_get (ETree *tree, int row, ETreePath path, int col,
break;
case DND_TARGET_TYPE_MESSAGE_RFC822:
{
- /* FIXME: this'll be fucking slow for the user... pthread this? */
+ CamelMimeFilter *filter;
CamelStream *stream;
- GByteArray *bytes;
+ CamelStream *mem;
- bytes = g_byte_array_new ();
- stream = camel_stream_mem_new ();
- camel_stream_mem_set_byte_array (CAMEL_STREAM_MEM (stream), bytes);
+ mem = camel_stream_mem_new ();
+
+ stream = camel_stream_filter_new_with_stream (mem);
+ filter = camel_mime_filter_from_new ();
+ camel_stream_filter_add (CAMEL_STREAM_FILTER (stream), filter);
+ camel_object_unref (filter);
for (i = 0; i < uids->len; i++) {
CamelMimeMessage *message;
@@ -398,17 +411,18 @@ message_list_drag_data_get (ETree *tree, int row, ETreePath path, int col,
if (message) {
camel_stream_write (stream, "From - \n", 8);
camel_data_wrapper_write_to_stream (CAMEL_DATA_WRAPPER (message), stream);
- camel_object_unref (CAMEL_OBJECT (message));
+ camel_object_unref (message);
}
}
g_ptr_array_free (uids, TRUE);
- camel_object_unref (CAMEL_OBJECT (stream));
+ camel_object_unref (stream);
gtk_selection_data_set (selection_data, selection_data->target, 8,
- bytes->data, bytes->len);
+ CAMEL_STREAM_MEM (mem)->buffer->data,
+ CAMEL_STREAM_MEM (mem)->buffer->len);
- g_byte_array_free (bytes, TRUE);
+ camel_object_unref (mem);
}
break;
case DND_TARGET_TYPE_X_EVOLUTION_MESSAGE: