aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-tools.c
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2005-03-04 11:15:38 +0800
committerMichael Zucci <zucchi@src.gnome.org>2005-03-04 11:15:38 +0800
commit2fad54d49c8a2380e9ab135160652c9aec6e8b7a (patch)
tree23c15b438926f27c41d44931bf9448f76311aa54 /mail/mail-tools.c
parent65d329aa11b37ca3fad9c76db0c8fa92ae451800 (diff)
downloadgsoc2013-evolution-2fad54d49c8a2380e9ab135160652c9aec6e8b7a.tar.gz
gsoc2013-evolution-2fad54d49c8a2380e9ab135160652c9aec6e8b7a.tar.zst
gsoc2013-evolution-2fad54d49c8a2380e9ab135160652c9aec6e8b7a.zip
** See bug #66592
2005-03-03 Not Zed <NotZed@Ximian.com> ** See bug #66592 * mail-tools.c (mail_tool_make_message_attachment): jus call camel_medium_remove_header to remove the bcc header, don't need to loop. * mail-ops.c (mail_send_message): try to find the account by uid first, fall back to name. * em-composer-utils.c (composer_get_message): set x-evolution-account by uid, not name. 2005-03-02 Not Zed <NotZed@Ximian.com> ** See bug #66592 * em-composer-utils.c (got_post_folder): no longer needed. (composer_get_message): remove 'post' and 'no_recipeints' args. * mail-ops.c (mail_send_message): change for xev changes. Also handle postto if set. * mail-tools.c (mail_tool_remove_xevolution_headers) (mail_tool_restore_xevolution_headers): fix for api change. (mail_tool_destroy_xevolution): remove. * mail-tools.h: remove XEvolution, just use a struct _header_raw for it. * em-composer-utils.c (em_utils_composer_send_cb): don't post message here, just queue it like any other outgoing mail. svn path=/trunk/; revision=28950
Diffstat (limited to 'mail/mail-tools.c')
-rw-r--r--mail/mail-tools.c69
1 files changed, 16 insertions, 53 deletions
diff --git a/mail/mail-tools.c b/mail/mail-tools.c
index b49fb38a43..858c7f018f 100644
--- a/mail/mail-tools.c
+++ b/mail/mail-tools.c
@@ -206,62 +206,26 @@ mail_tool_generate_forward_subject (CamelMimeMessage *msg)
return fwd_subj;
}
-XEvolution *
+struct _camel_header_raw *
mail_tool_remove_xevolution_headers (CamelMimeMessage *message)
{
- XEvolution *xev;
-
- xev = g_new (XEvolution, 1);
- xev->flags = g_strdup (camel_medium_get_header (CAMEL_MEDIUM (message), "X-Evolution"));
- xev->source = g_strdup (camel_medium_get_header (CAMEL_MEDIUM (message), "X-Evolution-Source"));
- xev->transport = g_strdup (camel_medium_get_header (CAMEL_MEDIUM (message), "X-Evolution-Transport"));
- xev->account = g_strdup (camel_medium_get_header (CAMEL_MEDIUM (message), "X-Evolution-Account"));
- xev->fcc = g_strdup (camel_medium_get_header (CAMEL_MEDIUM (message), "X-Evolution-Fcc"));
- xev->format = g_strdup (camel_medium_get_header (CAMEL_MEDIUM (message), "X-Evolution-Format"));
- xev->postto = g_strdup (camel_medium_get_header (CAMEL_MEDIUM (message), "X-Evolution-PostTo"));
-
- /* rip off the X-Evolution* headers */
- camel_medium_remove_header (CAMEL_MEDIUM (message), "X-Evolution");
- camel_medium_remove_header (CAMEL_MEDIUM (message), "X-Evolution-Source");
- camel_medium_remove_header (CAMEL_MEDIUM (message), "X-Evolution-Transport");
- camel_medium_remove_header (CAMEL_MEDIUM (message), "X-Evolution-Account");
- camel_medium_remove_header (CAMEL_MEDIUM (message), "X-Evolution-Fcc");
- camel_medium_remove_header (CAMEL_MEDIUM (message), "X-Evolution-Format");
- camel_medium_remove_header (CAMEL_MEDIUM (message), "X-Evolution-PostTo");
-
- return xev;
-}
+ struct _camel_header_raw *scan, *list = NULL;
-void
-mail_tool_restore_xevolution_headers (CamelMimeMessage *message, XEvolution *xev)
-{
- if (xev->flags)
- camel_medium_set_header (CAMEL_MEDIUM (message), "X-Evolution", xev->flags);
- if (xev->source)
- camel_medium_set_header (CAMEL_MEDIUM (message), "X-Evolution-Source", xev->source);
- if (xev->transport)
- camel_medium_set_header (CAMEL_MEDIUM (message), "X-Evolution-Transport", xev->transport);
- if (xev->account)
- camel_medium_set_header (CAMEL_MEDIUM (message), "X-Evolution-Account", xev->account);
- if (xev->fcc)
- camel_medium_set_header (CAMEL_MEDIUM (message), "X-Evolution-Fcc", xev->fcc);
- if (xev->format)
- camel_medium_set_header (CAMEL_MEDIUM (message), "X-Evolution-Format", xev->format);
- if (xev->postto)
- camel_medium_set_header (CAMEL_MEDIUM (message), "X-Evolution-PostTo", xev->postto);
+ for (scan = ((CamelMimePart *)message)->headers;scan;scan=scan->next)
+ if (!strncmp(scan->name, "X-Evolution", 11))
+ camel_header_raw_append(&list, scan->name, scan->value, scan->offset);
+
+ for (scan=list;scan;scan=scan->next)
+ camel_medium_remove_header((CamelMedium *)message, scan->name);
+
+ return list;
}
void
-mail_tool_destroy_xevolution (XEvolution *xev)
+mail_tool_restore_xevolution_headers (CamelMimeMessage *message, struct _camel_header_raw *xev)
{
- g_free (xev->flags);
- g_free (xev->source);
- g_free (xev->transport);
- g_free (xev->account);
- g_free (xev->format);
- g_free (xev->fcc);
- g_free (xev->postto);
- g_free (xev);
+ for (;xev;xev=xev->next)
+ camel_medium_add_header((CamelMedium *)message, xev->name, xev->value);
}
CamelMimePart *
@@ -269,7 +233,7 @@ mail_tool_make_message_attachment (CamelMimeMessage *message)
{
CamelMimePart *part;
const char *subject;
- XEvolution *xev;
+ struct _camel_header_raw *xev;
char *desc;
subject = camel_mime_message_get_subject (message);
@@ -280,11 +244,10 @@ mail_tool_make_message_attachment (CamelMimeMessage *message)
/* rip off the X-Evolution headers */
xev = mail_tool_remove_xevolution_headers (message);
- mail_tool_destroy_xevolution (xev);
+ camel_header_raw_clear(&xev);
/* remove Bcc headers */
- while (camel_medium_get_header (CAMEL_MEDIUM (message), "Bcc"))
- camel_medium_remove_header (CAMEL_MEDIUM (message), "Bcc");
+ camel_medium_remove_header (CAMEL_MEDIUM (message), "Bcc");
part = camel_mime_part_new ();
camel_mime_part_set_disposition (part, "inline");