aboutsummaryrefslogtreecommitdiffstats
path: root/composer/e-msg-composer-hdrs.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2001-01-18 13:44:08 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2001-01-18 13:44:08 +0800
commitf94261ab03b478c5d4ff859f6444ac4c23e21839 (patch)
treecfd60c8b71f11f91cc602702ff392db000097dc2 /composer/e-msg-composer-hdrs.c
parentd3781819c3243711edc60d5fdaf24c8c88a62c23 (diff)
downloadgsoc2013-evolution-f94261ab03b478c5d4ff859f6444ac4c23e21839.tar.gz
gsoc2013-evolution-f94261ab03b478c5d4ff859f6444ac4c23e21839.tar.zst
gsoc2013-evolution-f94261ab03b478c5d4ff859f6444ac4c23e21839.zip
Updated to reflect changes to e_msg_composer_hdrs_get_from().
2001-01-18 Jeffrey Stedfast <fejj@ximian.com> * e-msg-composer.c (build_message): Updated to reflect changes to e_msg_composer_hdrs_get_from(). * e-msg-composer-hdrs.c (set_recipients): Don't do anymore utf8 conversions, the widget already does this (or should unless there is brokenness). (e_msg_composer_hdrs_get_from): Return a CamelInternetAddress like we should. (e_msg_composer_hdrs_to_message): Update to reflect changes made the the above function. svn path=/trunk/; revision=7614
Diffstat (limited to 'composer/e-msg-composer-hdrs.c')
-rw-r--r--composer/e-msg-composer-hdrs.c48
1 files changed, 21 insertions, 27 deletions
diff --git a/composer/e-msg-composer-hdrs.c b/composer/e-msg-composer-hdrs.c
index 66aa80a88b..af22dcf611 100644
--- a/composer/e-msg-composer-hdrs.c
+++ b/composer/e-msg-composer-hdrs.c
@@ -496,25 +496,21 @@ e_msg_composer_hdrs_new (void)
static void
set_recipients (CamelMimeMessage *msg, GtkWidget *entry_widget, const gchar *type)
{
- char *s, *u;
CamelInternetAddress *addr;
-
- bonobo_widget_get_property (BONOBO_WIDGET (entry_widget), "text", &s, NULL);
-
- /* FIXME: This is just a temporary workaround, the widget should grok it */
- u = e_utf8_from_gtk_string(entry_widget, s);
-
- addr = camel_internet_address_new();
- camel_address_unformat((CamelAddress *)addr, u);
-
+ char *string;
+
+ bonobo_widget_get_property (BONOBO_WIDGET (entry_widget), "text", &string, NULL);
+
+ addr = camel_internet_address_new ();
+ camel_address_unformat (CAMEL_ADDRESS (addr), string);
+
/* TODO: In here, we could cross-reference the names with an alias book
or address book, it should be sufficient for unformat to do the parsing too */
-
- camel_mime_message_set_recipients(msg, type, addr);
-
- camel_object_unref((CamelObject *)addr);
- g_free(s);
- g_free(u);
+
+ camel_mime_message_set_recipients (msg, type, addr);
+
+ camel_object_unref (CAMEL_OBJECT (addr));
+ g_free (string);
}
void
@@ -522,7 +518,6 @@ e_msg_composer_hdrs_to_message (EMsgComposerHdrs *hdrs,
CamelMimeMessage *msg)
{
gchar *subject;
- char *fromstr;
CamelInternetAddress *from;
g_return_if_fail (hdrs != NULL);
@@ -533,14 +528,10 @@ e_msg_composer_hdrs_to_message (EMsgComposerHdrs *hdrs,
subject = e_msg_composer_hdrs_get_subject (hdrs);
camel_mime_message_set_subject (msg, subject);
g_free (subject);
-
- /* get_from() should probably return a CamelInternetAddress anyway */
- fromstr = e_msg_composer_hdrs_get_from (hdrs);
- from = camel_internet_address_new();
- camel_address_unformat((CamelAddress *)from, fromstr);
+
+ from = e_msg_composer_hdrs_get_from (hdrs);
camel_mime_message_set_from (msg, from);
- camel_object_unref((CamelObject *)from);
- g_free(fromstr);
+ camel_object_unref (CAMEL_OBJECT (from));
set_recipients (msg, hdrs->priv->to_entry, CAMEL_RECIPIENT_TYPE_TO);
set_recipients (msg, hdrs->priv->cc_entry, CAMEL_RECIPIENT_TYPE_CC);
@@ -645,11 +636,11 @@ e_msg_composer_hdrs_set_subject (EMsgComposerHdrs *hdrs,
}
-/* FIXME: This should probably return a CamelInternetAddress */
-char *
+CamelInternetAddress *
e_msg_composer_hdrs_get_from (EMsgComposerHdrs *hdrs)
{
const MailConfigAccount *account;
+ CamelInternetAddress *addr;
g_return_val_if_fail (hdrs != NULL, NULL);
g_return_val_if_fail (E_IS_MSG_COMPOSER_HDRS (hdrs), NULL);
@@ -660,7 +651,10 @@ e_msg_composer_hdrs_get_from (EMsgComposerHdrs *hdrs)
return NULL;
}
- return camel_internet_address_format_address (account->id->name, account->id->address);
+ addr = camel_internet_address_new ();
+ camel_internet_address_add (addr, account->id->name, account->id->address);
+
+ return addr;
}
/* FIXME this is currently unused and broken. */