aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mail-to-task/mail-to-task.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/mail-to-task/mail-to-task.c')
-rw-r--r--plugins/mail-to-task/mail-to-task.c31
1 files changed, 12 insertions, 19 deletions
diff --git a/plugins/mail-to-task/mail-to-task.c b/plugins/mail-to-task/mail-to-task.c
index 17bc6a995b..f2e3f98435 100644
--- a/plugins/mail-to-task/mail-to-task.c
+++ b/plugins/mail-to-task/mail-to-task.c
@@ -38,14 +38,6 @@
#include <libedataserver/e-account.h>
#include <libedataserverui/e-source-selector-dialog.h>
-#include <camel/camel-folder.h>
-#include <camel/camel-medium.h>
-#include <camel/camel-mime-message.h>
-#include <camel/camel-multipart.h>
-#include <camel/camel-stream.h>
-#include <camel/camel-stream-mem.h>
-#include <camel/camel-utf8.h>
-
#include <mail/e-mail-browser.h>
#include <mail/em-utils.h>
#include <mail/em-format-html.h>
@@ -79,7 +71,7 @@ set_attendees (ECalComponent *comp, CamelMimeMessage *message, const gchar *orga
{
GSList *attendees = NULL, *to_free = NULL;
ECalComponentAttendee *ca;
- const CamelInternetAddress *from = NULL, *to, *cc, *bcc, *arr[4];
+ CamelInternetAddress *from = NULL, *to, *cc, *bcc, *arr[4];
gint len, i, j;
if (message->reply_to)
@@ -149,7 +141,7 @@ prepend_from (CamelMimeMessage *message, gchar **text)
{
gchar *res, *tmp, *addr = NULL;
const gchar *name = NULL, *eml = NULL;
- const CamelInternetAddress *from = NULL;
+ CamelInternetAddress *from = NULL;
g_return_val_if_fail (message != NULL, NULL);
g_return_val_if_fail (text != NULL, NULL);
@@ -179,16 +171,17 @@ static void
set_description (ECalComponent *comp, CamelMimeMessage *message)
{
CamelDataWrapper *content;
- CamelStream *mem;
+ CamelStream *stream;
CamelContentType *type;
CamelMimePart *mime_part = CAMEL_MIME_PART (message);
ECalComponentText text;
+ GByteArray *byte_array;
GSList sl;
gchar *str, *convert_str = NULL;
gsize bytes_read, bytes_written;
gint count = 2;
- content = camel_medium_get_content_object ((CamelMedium *) message);
+ content = camel_medium_get_content ((CamelMedium *) message);
if (!content)
return;
@@ -197,7 +190,7 @@ set_description (ECalComponent *comp, CamelMimeMessage *message)
*/
while (CAMEL_IS_MULTIPART (content) && count > 0) {
mime_part = camel_multipart_get_part (CAMEL_MULTIPART (content), 0);
- content = camel_medium_get_content_object (CAMEL_MEDIUM (mime_part));
+ content = camel_medium_get_content (CAMEL_MEDIUM (mime_part));
count--;
}
@@ -208,11 +201,11 @@ set_description (ECalComponent *comp, CamelMimeMessage *message)
if (!camel_content_type_is (type, "text", "plain"))
return;
- mem = camel_stream_mem_new ();
- camel_data_wrapper_decode_to_stream (content, mem);
-
- str = g_strndup ((const gchar *)((CamelStreamMem *) mem)->buffer->data, ((CamelStreamMem *) mem)->buffer->len);
- camel_object_unref (mem);
+ byte_array = g_byte_array_new ();
+ stream = camel_stream_mem_new_with_byte_array (byte_array);
+ camel_data_wrapper_decode_to_stream (content, stream);
+ str = g_strndup ((gchar *) byte_array->data, byte_array->len);
+ g_object_unref (stream);
/* convert to UTF-8 string */
if (str && content->mime_type->params && content->mime_type->params->value) {
@@ -320,7 +313,7 @@ set_attachments (ECal *client, ECalComponent *comp, CamelMimeMessage *message)
gboolean done;
} status;
- content = camel_medium_get_content_object ((CamelMedium *) message);
+ content = camel_medium_get_content ((CamelMedium *) message);
if (!content || !CAMEL_IS_MULTIPART (content))
return;