When saving a draft, attach information about the From: identity via

2001-06-08  Jon Trowbridge  <trow@ximian.com>

	* e-msg-composer.c (save_draft): When saving a draft, attach
	information about the From: identity via X-Evolution-Account.
	This lets us select the correct identity when we edit it later.
	(e_msg_composer_new_with_message): If the message we are editting
	is tagged with an account (via X-Evolution-Account), make sure
	that the composer chooses that account's identity by default.

svn path=/trunk/; revision=10161
This commit is contained in:
Jon Trowbridge
2001-06-08 20:00:54 +00:00
committed by Jon Trowbridge
parent 63f6e70ecc
commit 1cb2bd29be
2 changed files with 24 additions and 2 deletions

View File

@ -1,3 +1,12 @@
2001-06-08 Jon Trowbridge <trow@ximian.com>
* e-msg-composer.c (save_draft): When saving a draft, attach
information about the From: identity via X-Evolution-Account.
This lets us select the correct identity when we edit it later.
(e_msg_composer_new_with_message): If the message we are editting
is tagged with an account (via X-Evolution-Account), make sure
that the composer chooses that account's identity by default.
2001-06-08 Dan Winship <danw@ximian.com>
* e-msg-composer.c (best_charset): Don't use the default charset

View File

@ -41,6 +41,7 @@
#endif
#include <errno.h>
#include <ctype.h>
#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-config.h>
#include <libgnomeui/gnome-app.h>
@ -907,6 +908,10 @@ save_draft (EMsgComposer *composer, int quitok)
composer->send_html = TRUE;
msg = e_msg_composer_get_message (composer);
composer->send_html = old_send_html;
/* Attach account info to the draft. */
if (account && account->name)
camel_medium_set_header (CAMEL_MEDIUM (msg), "X-Evolution-Account", account->name);
info = g_new0 (CamelMessageInfo, 1);
info->flags = CAMEL_MESSAGE_DRAFT | CAMEL_MESSAGE_SEEN;
@ -2217,6 +2222,7 @@ e_msg_composer_new_with_message (CamelMimeMessage *msg)
const gchar *subject;
EMsgComposer *new;
guint len, i;
const gchar *account_name = NULL;
g_return_val_if_fail (gtk_main_level () > 0, NULL);
@ -2225,7 +2231,7 @@ e_msg_composer_new_with_message (CamelMimeMessage *msg)
return NULL;
subject = camel_mime_message_get_subject (msg);
to = camel_mime_message_get_recipients (msg, CAMEL_RECIPIENT_TYPE_TO);
cc = camel_mime_message_get_recipients (msg, CAMEL_RECIPIENT_TYPE_CC);
bcc = camel_mime_message_get_recipients (msg, CAMEL_RECIPIENT_TYPE_BCC);
@ -2272,7 +2278,14 @@ e_msg_composer_new_with_message (CamelMimeMessage *msg)
}
}
e_msg_composer_set_headers (new, NULL, To, Cc, Bcc, subject);
account_name = camel_medium_get_header (CAMEL_MEDIUM (msg), "X-Evolution-Account");
if (account_name) {
while (*account_name && isspace (*account_name))
++account_name;
camel_medium_remove_header (CAMEL_MEDIUM (msg), "X-Evolution-Account");
}
e_msg_composer_set_headers (new, account_name, To, Cc, Bcc, subject);
free_recipients (To);
free_recipients (Cc);