aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Trowbridge <trow@ximian.com>2001-10-11 04:47:46 +0800
committerJon Trowbridge <trow@src.gnome.org>2001-10-11 04:47:46 +0800
commit7e628d1745b79a7af4529d9cb2c2957613e1328a (patch)
tree1a1099c14f09bd0dcb903f1a0068ba821939c4b1
parent484c8193e1ae11a967e002b132dd04fa8b4e460d (diff)
downloadgsoc2013-evolution-7e628d1745b79a7af4529d9cb2c2957613e1328a.tar.gz
gsoc2013-evolution-7e628d1745b79a7af4529d9cb2c2957613e1328a.tar.zst
gsoc2013-evolution-7e628d1745b79a7af4529d9cb2c2957613e1328a.zip
Check for either a matching account name, or for a matching e-mail address
2001-10-10 Jon Trowbridge <trow@ximian.com> * e-msg-composer-hdrs.c (e_msg_composer_hdrs_set_from_account): Check for either a matching account name, or for a matching e-mail address embedded in the passed-in string. (Fixes half of bug #3255) (destroy): Call bonobo_object_release_unref on corba_select_names, not CORBA_Object_release. Otherwise we leak stuff all over the place. (Bug #11878) * e-msg-composer.c (e_msg_composer_new_with_message): If our message doesn't contain an X-Evolution-Account header, pass in the From header as the account name. (Fixes the other half of #3255) svn path=/trunk/; revision=13567
-rw-r--r--composer/ChangeLog14
-rw-r--r--composer/e-msg-composer-hdrs.c13
-rw-r--r--composer/e-msg-composer.c3
3 files changed, 25 insertions, 5 deletions
diff --git a/composer/ChangeLog b/composer/ChangeLog
index bc9184ece5..76cc7ddf47 100644
--- a/composer/ChangeLog
+++ b/composer/ChangeLog
@@ -1,3 +1,17 @@
+2001-10-10 Jon Trowbridge <trow@ximian.com>
+
+ * e-msg-composer-hdrs.c (e_msg_composer_hdrs_set_from_account):
+ Check for either a matching account name, or for a matching e-mail
+ address embedded in the passed-in string. (Fixes half of bug
+ #3255)
+ (destroy): Call bonobo_object_release_unref on corba_select_names,
+ not CORBA_Object_release. Otherwise we leak stuff all over the
+ place. (Bug #11878)
+
+ * e-msg-composer.c (e_msg_composer_new_with_message): If our message
+ doesn't contain an X-Evolution-Account header, pass in the From
+ header as the account name. (Fixes the other half of #3255)
+
2001-10-10 Larry Ewing <lewing@ximian.com>
* e-msg-composer.h: add prototype.
diff --git a/composer/e-msg-composer-hdrs.c b/composer/e-msg-composer-hdrs.c
index 90bbddd941..ec08a94f7a 100644
--- a/composer/e-msg-composer-hdrs.c
+++ b/composer/e-msg-composer-hdrs.c
@@ -497,9 +497,8 @@ destroy (GtkObject *object)
if (priv->corba_select_names != CORBA_OBJECT_NIL) {
CORBA_Environment ev;
-
CORBA_exception_init (&ev);
- CORBA_Object_release (priv->corba_select_names, &ev);
+ bonobo_object_release_unref (priv->corba_select_names, &ev);
CORBA_exception_free (&ev);
}
@@ -770,7 +769,10 @@ e_msg_composer_hdrs_set_from_account (EMsgComposerHdrs *hdrs,
omenu = GTK_OPTION_MENU (hdrs->priv->from.entry);
- default_account = mail_config_get_default_account_num ();
+ if (account_name)
+ default_account = -1;
+ else
+ default_account = mail_config_get_default_account_num ();
/* find the item that represents the account and activate it */
l = hdrs->priv->from_options;
@@ -779,8 +781,9 @@ e_msg_composer_hdrs_set_from_account (EMsgComposerHdrs *hdrs,
item = l->data;
account = gtk_object_get_data (GTK_OBJECT (item), "account");
- if ((account_name && !strcmp (account_name, account->name)) ||
- (!account_name && i == default_account)) {
+ if (i == default_account ||
+ (account_name && ((account->name && !strcmp (account_name, account->name))
+ || (account->id->address && strstr (account_name, account->id->address))))) {
/* set the correct optionlist item */
gtk_option_menu_set_history (omenu, i);
gtk_signal_emit_by_name (GTK_OBJECT (item), "activate", hdrs);
diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c
index ce79fe1fb5..72210b4c16 100644
--- a/composer/e-msg-composer.c
+++ b/composer/e-msg-composer.c
@@ -2710,6 +2710,9 @@ e_msg_composer_new_with_message (CamelMimeMessage *msg)
while (*account_name && isspace ((unsigned) *account_name))
account_name++;
}
+ if (account_name == NULL) {
+ account_name = camel_medium_get_header (CAMEL_MEDIUM (msg), "From");
+ }
e_msg_composer_set_headers (new, account_name, Tov, Ccv, Bccv, subject);