diff options
author | Not Zed <NotZed@Ximian.com> | 2005-03-04 11:15:21 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2005-03-04 11:15:21 +0800 |
commit | 65d329aa11b37ca3fad9c76db0c8fa92ae451800 (patch) | |
tree | 4fcf4adc9b94f20470f48baccdc719d7c8627243 /composer/e-msg-composer.c | |
parent | 9b6b99d33db08122c8bd039f15f197c5ae7cb5d1 (diff) | |
download | gsoc2013-evolution-65d329aa11b37ca3fad9c76db0c8fa92ae451800.tar gsoc2013-evolution-65d329aa11b37ca3fad9c76db0c8fa92ae451800.tar.gz gsoc2013-evolution-65d329aa11b37ca3fad9c76db0c8fa92ae451800.tar.bz2 gsoc2013-evolution-65d329aa11b37ca3fad9c76db0c8fa92ae451800.tar.lz gsoc2013-evolution-65d329aa11b37ca3fad9c76db0c8fa92ae451800.tar.xz 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
Diffstat (limited to 'composer/e-msg-composer.c')
-rw-r--r-- | composer/e-msg-composer.c | 34 |
1 files changed, 23 insertions, 11 deletions
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() */ |