aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--composer/ChangeLog13
-rw-r--r--composer/e-msg-composer-hdrs.c48
-rw-r--r--composer/e-msg-composer-hdrs.h2
-rw-r--r--composer/e-msg-composer.c4
4 files changed, 37 insertions, 30 deletions
diff --git a/composer/ChangeLog b/composer/ChangeLog
index 9f6bd3d726..cff16bc2d7 100644
--- a/composer/ChangeLog
+++ b/composer/ChangeLog
@@ -1,3 +1,16 @@
+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.
+
2001-01-12 Miguel de Icaza <miguel@gnu.org>
* Makefile.am: Make the composer a standard library, not a libtool
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. */
diff --git a/composer/e-msg-composer-hdrs.h b/composer/e-msg-composer-hdrs.h
index 8be7375b98..dc48356c06 100644
--- a/composer/e-msg-composer-hdrs.h
+++ b/composer/e-msg-composer-hdrs.h
@@ -80,7 +80,7 @@ void e_msg_composer_hdrs_set_bcc (EMsgComposerHdrs *hdrs,
void e_msg_composer_hdrs_set_subject (EMsgComposerHdrs *hdrs,
const char *subject);
-char *e_msg_composer_hdrs_get_from (EMsgComposerHdrs *hdrs);
+CamelInternetAddress *e_msg_composer_hdrs_get_from (EMsgComposerHdrs *hdrs);
GList *e_msg_composer_hdrs_get_to (EMsgComposerHdrs *hdrs);
GList *e_msg_composer_hdrs_get_cc (EMsgComposerHdrs *hdrs);
GList *e_msg_composer_hdrs_get_bcc (EMsgComposerHdrs *hdrs);
diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c
index 2b12abad04..1b68d28f2e 100644
--- a/composer/e-msg-composer.c
+++ b/composer/e-msg-composer.c
@@ -240,10 +240,10 @@ build_message (EMsgComposer *composer)
EMsgComposerAttachmentBar *attachment_bar =
E_MSG_COMPOSER_ATTACHMENT_BAR (composer->attachment_bar);
MsgFormat type = MSG_FORMAT_ALTERNATIVE;
+ CamelInternetAddress *from;
CamelMimeMessage *new;
CamelMultipart *body = NULL;
CamelMimePart *part;
- gchar *from = NULL;
gboolean plain_e8bit = FALSE, html_e8bit = FALSE;
char *html = NULL, *plain = NULL;
char *content_type = NULL;
@@ -271,7 +271,7 @@ build_message (EMsgComposer *composer)
e_msg_composer_hdrs_set_from_account (E_MSG_COMPOSER_HDRS (composer->hdrs), account->name);
}
- g_free (from);
+ camel_object_unref (CAMEL_OBJECT (from));
new = camel_mime_message_new ();