aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2005-03-04 11:15:21 +0800
committerMichael Zucci <zucchi@src.gnome.org>2005-03-04 11:15:21 +0800
commit65d329aa11b37ca3fad9c76db0c8fa92ae451800 (patch)
tree4fcf4adc9b94f20470f48baccdc719d7c8627243
parent9b6b99d33db08122c8bd039f15f197c5ae7cb5d1 (diff)
downloadgsoc2013-evolution-65d329aa11b37ca3fad9c76db0c8fa92ae451800.tar.gz
gsoc2013-evolution-65d329aa11b37ca3fad9c76db0c8fa92ae451800.tar.zst
gsoc2013-evolution-65d329aa11b37ca3fad9c76db0c8fa92ae451800.zip
** See bug #66592
2005-03-03 Not Zed <NotZed@Ximian.com> ** See bug #66592 * e-msg-composer.c (e_msg_composer_get_message_draft): set the uid for the x-evolution-account, not the account name, which can change. (e_msg_composer_new_with_message): find the account by uid first, fallback to name search. svn path=/trunk/; revision=28949
-rw-r--r--composer/ChangeLog25
-rw-r--r--composer/e-msg-composer-hdrs.c23
-rw-r--r--composer/e-msg-composer.c34
3 files changed, 63 insertions, 19 deletions
diff --git a/composer/ChangeLog b/composer/ChangeLog
index ddd7bf10dc..83987cc24a 100644
--- a/composer/ChangeLog
+++ b/composer/ChangeLog
@@ -1,3 +1,28 @@
+2005-03-03 Not Zed <NotZed@Ximian.com>
+
+ ** See bug #66592
+
+ * e-msg-composer.c (e_msg_composer_get_message_draft): set the uid
+ for the x-evolution-account, not the account name, which can
+ change.
+ (e_msg_composer_new_with_message): find the account by uid first,
+ fallback to name search.
+
+2005-03-02 Not Zed <NotZed@Ximian.com>
+
+ ** See bug #66592
+
+ * e-msg-composer.c (e_msg_composer_new_with_message): scan all
+ x-evolution-postto headers. This makes post-to drafts work
+ properly.
+ (e_msg_composer_new_with_message): change for XEvolution removal.
+
+ * e-msg-composer-hdrs.c (set_pair_visibility): track visibility
+ ourselves.
+ (e_msg_composer_hdrs_to_message_internal): dont use the visibility
+ mask to determine what headers to add, use the actually shown
+ list. Add back the x-evolution-postto headers.
+
2005-02-15 Jeffrey Stedfast <fejj@novell.com>
* e-msg-composer-select-file.c (select_attach_response): Fix
diff --git a/composer/e-msg-composer-hdrs.c b/composer/e-msg-composer-hdrs.c
index f8ad7c6717..b5c6ee7d56 100644
--- a/composer/e-msg-composer-hdrs.c
+++ b/composer/e-msg-composer-hdrs.c
@@ -83,6 +83,7 @@
typedef struct {
GtkWidget *label;
GtkWidget *entry;
+ int visible:1;
} EMsgComposerHdrPair;
struct _EMsgComposerHdrsPrivate {
@@ -676,6 +677,8 @@ set_pair_visibility (EMsgComposerHdrs *h, EMsgComposerHdrPair *pair, int visible
gtk_widget_hide (pair->label);
gtk_widget_hide (pair->entry);
}
+
+ pair->visible = TRUE;
}
static void
@@ -1000,7 +1003,7 @@ e_msg_composer_hdrs_to_message_internal (EMsgComposerHdrs *hdrs,
CamelInternetAddress *addr;
const char *subject;
char *header;
-
+
g_return_if_fail (E_IS_MSG_COMPOSER_HDRS (hdrs));
g_return_if_fail (CAMEL_IS_MIME_MESSAGE (msg));
@@ -1023,7 +1026,7 @@ e_msg_composer_hdrs_to_message_internal (EMsgComposerHdrs *hdrs,
camel_object_unref (addr);
}
- if (hdrs->visible_mask & E_MSG_COMPOSER_VISIBLE_MASK_RECIPIENTS) {
+ if (hdrs->priv->to.visible || hdrs->priv->cc.visible || hdrs->priv->bcc.visible) {
to_destv = e_msg_composer_hdrs_get_to (hdrs);
cc_destv = e_msg_composer_hdrs_get_cc (hdrs);
bcc_destv = e_msg_composer_hdrs_get_bcc (hdrs);
@@ -1037,13 +1040,17 @@ e_msg_composer_hdrs_to_message_internal (EMsgComposerHdrs *hdrs,
e_destination_freev (bcc_destv);
}
-#if 0
- if (hdrs->visible_mask & E_MSG_COMPOSER_VISIBLE_POSTTO) {
- header = e_msg_composer_hdrs_get_post_to (hdrs);
- camel_medium_set_header (CAMEL_MEDIUM (msg), "X-Evolution-PostTo", header);
- g_free (header);
+ if (hdrs->priv->post_to.visible) {
+ GList *post, *l;
+
+ camel_medium_remove_header((CamelMedium *)msg, "X-Evolution-PostTo");
+ post = e_msg_composer_hdrs_get_post_to(hdrs);
+ for (l=post;l;l=g_list_next(l)) {
+ camel_medium_add_header((CamelMedium *)msg, "X-Evolution-PostTo", l->data);
+ g_free(l->data);
+ }
+ g_list_free(post);
}
-#endif
}
diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c
index 76483c76b6..a531bcab84 100644
--- a/composer/e-msg-composer.c
+++ b/composer/e-msg-composer.c
@@ -3992,8 +3992,8 @@ EMsgComposer *
e_msg_composer_new_with_message (CamelMimeMessage *message)
{
const CamelInternetAddress *to, *cc, *bcc;
- GList *To = NULL, *Cc = NULL, *Bcc = NULL;
- const char *format, *subject, *postto;
+ GList *To = NULL, *Cc = NULL, *Bcc = NULL, *postto = NULL;
+ const char *format, *subject;
EDestination **Tov, **Ccv, **Bccv;
GHashTable *auto_cc, *auto_bcc;
CamelContentType *content_type;
@@ -4002,17 +4002,27 @@ e_msg_composer_new_with_message (CamelMimeMessage *message)
EAccount *account = NULL;
char *account_name;
EMsgComposer *new;
- XEvolution *xev;
+ struct _camel_header_raw *xev;
int len, i;
- postto = camel_medium_get_header (CAMEL_MEDIUM (message), "X-Evolution-PostTo");
-
+ for (headers = CAMEL_MIME_PART (message)->headers;headers;headers = headers->next) {
+ if (!strcmp(headers->name, "X-Evolution-PostTo"))
+ postto = g_list_append(postto, g_strstrip(g_strdup(headers->value)));
+ }
+
new = create_composer (postto ? E_MSG_COMPOSER_VISIBLE_MASK_POST : E_MSG_COMPOSER_VISIBLE_MASK_MAIL);
- if (!new)
+ if (!new) {
+ g_list_foreach(postto, (GFunc)g_free, NULL);
+ g_list_free(postto);
return NULL;
+ }
- if (postto)
- e_msg_composer_hdrs_set_post_to (E_MSG_COMPOSER_HDRS (new->hdrs), postto);
+ if (postto) {
+ e_msg_composer_hdrs_set_post_to_list(E_MSG_COMPOSER_HDRS (new->hdrs), postto);
+ g_list_foreach(postto, (GFunc)g_free, NULL);
+ g_list_free(postto);
+ postto = NULL;
+ }
/* Restore the Account preference */
account_name = (char *) camel_medium_get_header (CAMEL_MEDIUM (message), "X-Evolution-Account");
@@ -4020,7 +4030,9 @@ e_msg_composer_new_with_message (CamelMimeMessage *message)
account_name = g_strdup (account_name);
g_strstrip (account_name);
- account = mail_config_get_account_by_name (account_name);
+ if ((account = mail_config_get_account_by_uid(account_name)) == NULL)
+ /* 'old' setting */
+ account = mail_config_get_account_by_name(account_name);
}
if (postto == NULL) {
@@ -4167,7 +4179,7 @@ e_msg_composer_new_with_message (CamelMimeMessage *message)
/* Remove any other X-Evolution-* headers that may have been set */
xev = mail_tool_remove_xevolution_headers (message);
- mail_tool_destroy_xevolution (xev);
+ camel_header_raw_clear(&xev);
/* set extra headers */
headers = CAMEL_MIME_PART (message)->headers;
@@ -4742,7 +4754,7 @@ e_msg_composer_get_message_draft (EMsgComposer *composer)
/* Attach account info to the draft. */
account = e_msg_composer_get_preferred_account (composer);
if (account && account->name)
- camel_medium_set_header (CAMEL_MEDIUM (msg), "X-Evolution-Account", account->name);
+ camel_medium_set_header (CAMEL_MEDIUM (msg), "X-Evolution-Account", account->uid);
/* build_message() set this to text/html since we set composer->send_html to
TRUE before calling e_msg_composer_get_message() */