aboutsummaryrefslogtreecommitdiffstats
path: root/composer/e-msg-composer.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@helixcode.com>2001-01-13 05:13:26 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2001-01-13 05:13:26 +0800
commit8ad2b343a02b954f2393e08deece19861352329e (patch)
tree4eb49b0956aeda5cbec9ef6ee51967202f5f52b3 /composer/e-msg-composer.c
parentd9a01d4e270df5a5332808b4c2e34f688f65d10b (diff)
downloadgsoc2013-evolution-8ad2b343a02b954f2393e08deece19861352329e.tar.gz
gsoc2013-evolution-8ad2b343a02b954f2393e08deece19861352329e.tar.zst
gsoc2013-evolution-8ad2b343a02b954f2393e08deece19861352329e.zip
Call set_from_account which means we no longer have to do all the crap
2001-01-12 Jeffrey Stedfast <fejj@helixcode.com> * e-msg-composer.c (build_message): Call set_from_account which means we no longer have to do all the crap involved in formatting strings into an internet-address. (e_msg_composer_get_preferred_account): New access function. * e-msg-composer-hdrs.c (add_header): case COMBOBOX has changed to OPTIOMENU. (create_optionmenu): Update to use an optionmenu of accounts. (from_changed): New callback for the From optionmenu. (setup_headers): s/COMBOBOX/OPTIONMENU (init): Set the account and from_options to NULL. (e_msg_composer_hdrs_get_from): Updated. (destroy): free the from_options. (e_msg_composer_hdrs_set_from_address): Renamed from set_from because it no longer takes a string arg but rather an account arg. svn path=/trunk/; revision=7458
Diffstat (limited to 'composer/e-msg-composer.c')
-rw-r--r--composer/e-msg-composer.c36
1 files changed, 28 insertions, 8 deletions
diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c
index 369b207dc2..9c63c962dc 100644
--- a/composer/e-msg-composer.c
+++ b/composer/e-msg-composer.c
@@ -261,15 +261,15 @@ build_message (EMsgComposer *composer)
/* get and/or set the From field */
from = e_msg_composer_hdrs_get_from (E_MSG_COMPOSER_HDRS (composer->hdrs));
if (!from) {
- const MailConfigIdentity *id = NULL;
- CamelInternetAddress *ciaddr;
+ const MailConfigAccount *account = NULL;
- id = mail_config_get_default_identity ();
- ciaddr = camel_internet_address_new ();
- camel_internet_address_add (ciaddr, id->name, id->address);
- from = camel_address_encode (CAMEL_ADDRESS (ciaddr));
- e_msg_composer_hdrs_set_from (E_MSG_COMPOSER_HDRS (composer->hdrs), from);
- camel_object_unref (CAMEL_OBJECT (ciaddr));
+ account = mail_config_get_default_account ();
+
+ /* if !account then we have mucho problemos, amigo */
+ if (!account)
+ return NULL;
+
+ e_msg_composer_hdrs_set_from_account (E_MSG_COMPOSER_HDRS (composer->hdrs), account->name);
}
g_free (from);
@@ -2061,6 +2061,26 @@ e_msg_composer_get_send_html (EMsgComposer *composer)
/**
+ * e_msg_composer_get_preferred_account:
+ * @composer: composer
+ *
+ * Returns the user-specified account (from field).
+ */
+const MailConfigAccount *
+e_msg_composer_get_preferred_account (EMsgComposer *composer)
+{
+ EMsgComposerHdrs *hdrs;
+
+ g_return_val_if_fail (composer != NULL, NULL);
+ g_return_val_if_fail (E_IS_MSG_COMPOSER (composer), NULL);
+
+ hdrs = E_MSG_COMPOSER_HDRS (composer->hdrs);
+
+ return hdrs->account;
+}
+
+
+/**
* e_msg_composer_set_pgp_sign:
* @composer: A message composer widget
* @send_html: Whether the composer should have the "PGP Sign" flag set
td>thierry2005-07-162-5/+5 * Update to 20050630.thierry2005-07-012-5/+5 * Upgrade to 6/24/2005.thierry2005-06-262-5/+5 * Upgrade to 20050622: catch the wildly prolific new Mytob-GB variant virus.thierry2005-06-232-5/+5 * Upgrade to 2.0 final.thierry2005-06-222-12/+12 * Upgrade to 2.0 beta, RC8.thierry2005-05-282-6/+5 * Yet another silent update: the list of ip has been updated inthierry2005-05-202-2/+3 * Upgrade to 2.0 beta, RC8.thierry2005-05-162-5/+5 * Yet another SpamBouncer 2.0 Beta RC7 release.thierry2005-04-212-6/+5 * Yet another silent update...thierry2005-04-122-2/+3 * Upgrade to 2.0 beta, RC7.thierry2005-04-122-5/+5 * Unbreak by upgrading to 2.0-RC7.thierry2005-04-052-7/+5 * BROKEN: Size mismatchkris2005-03-261-0/+2 * Upgrade to 20050302.thierry2005-03-042-5/+5 * Upgrade to 20050228 snapshot (2.0 beta RC6).thierry2005-03-022-5/+5 * Upgrade to 2.0 beta RC6.thierry2005-02-262-7/+7 * Upgrade to 2.0-RC5.thierry2005-02-012-5/+5 * Upgrade to 20050119, aka 2.0-RC4.thierry2005-01-213-6/+6 * Upgrade to 20050115.thierry2005-01-184-12/+31 * Yet another "latest" release before 2.0!thierry2004-12-242-4/+4 * Upgrade to latest snapshot.thierry2004-12-112-5/+5 * Update to latest snapshot.thierry2004-11-242-4/+4 * Upgrade to latest snapshot.thierry2004-11-192-4/+4 * Upgrade to latest snapshot.thierry2004-11-012-4/+4 * Upgrade to latest snapshot.thierry2004-10-222-5/+4 * Yet another SpamBouncer's silent update!thierry2004-10-132-2/+3 * Upgrade to latest snapshot and unbreak.thierry2004-09-252-4/+4 * Upgrade to latest snapshot and make fetchable again.thierry2004-09-222-4/+4 * Upgrade to 20040820.thierry2004-08-212-4/+4 * Upgrade to 20040813.thierry2004-08-142-4/+4 * Upgrade to 20040812.thierry2004-08-132-4/+4 * Upgrade to latest snapshot.thierry2004-08-012-4/+4 * Upgrade to latest snapshot.thierry2004-07-312-4/+4 * Upgrade to 20040715.thierry2004-07-172-4/+4 * Tarball has been rerolled.thierry2004-07-021-1/+1 * Upgrade to the latest snapshot.thierry2004-06-292-4/+4 * This is just another silent update: the tarball has been rerolled,thierry2004-05-262-4/+4 * Upgrade to latest snapshot.thierry2004-05-142-4/+4 * Upgrade to 20040421.thierry2004-04-232-4/+4 * Unbreak (tarball had been rerolled, no significative change).thierry2004-04-032-3/+1 * BROKEN: Checksum mismatchkris2004-04-031-0/+2 * Upgrade the SpamBouncer to 20040328.thierry2004-03-292-4/+4 * Upgrade the SpamBouncer to 20040323.thierry2004-03-242-4/+4 * - Update to version 20040302krion2004-03-042-4/+4 * - Update to version 20040301krion2004-03-032-4/+4 * - Update to version 20040225krion2004-02-272