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