aboutsummaryrefslogtreecommitdiffstats
path: root/composer
diff options
context:
space:
mode:
Diffstat (limited to 'composer')
-rw-r--r--composer/ChangeLog7
-rw-r--r--composer/Makefile.am1
-rw-r--r--composer/e-msg-composer-hdrs.c32
3 files changed, 33 insertions, 7 deletions
diff --git a/composer/ChangeLog b/composer/ChangeLog
index 4d09888796..5c78b35db6 100644
--- a/composer/ChangeLog
+++ b/composer/ChangeLog
@@ -1,3 +1,10 @@
+2001-05-18 Jon Trowbridge <trow@ximian.com>
+
+ * e-msg-composer-hdrs.c (set_recipients): Properly unserialize the
+ string returned by the "text" property of the bonobo control,
+ convert it into EDestinations, and use them to get the e-mail
+ addresses of our recipients.
+
2001-05-17 Dan Winship <danw@ximian.com>
* e-msg-composer.c (save_draft): Draft messages should be marked
diff --git a/composer/Makefile.am b/composer/Makefile.am
index ad78500587..898c372e5e 100644
--- a/composer/Makefile.am
+++ b/composer/Makefile.am
@@ -48,6 +48,7 @@ INCLUDES = \
-I$(top_builddir)/widgets \
-I$(top_srcdir)/camel \
-I$(top_builddir)/camel \
+ -I$(top_builddir)/addressbook/backend/ebook \
-I$(top_builddir)/addressbook/gui/component/select-names \
-I$(top_builddir)/shell \
-I$(top_srcdir)/shell \
diff --git a/composer/e-msg-composer-hdrs.c b/composer/e-msg-composer-hdrs.c
index d31ac118fc..74932d1ca1 100644
--- a/composer/e-msg-composer-hdrs.c
+++ b/composer/e-msg-composer-hdrs.c
@@ -44,6 +44,7 @@
#include <gal/widgets/e-unicode.h>
#include <camel/camel.h>
+#include <e-destination.h>
#include "e-msg-composer-hdrs.h"
#include "mail/mail-config.h"
@@ -630,20 +631,37 @@ e_msg_composer_hdrs_new (gint visible_flags)
static void
set_recipients (CamelMimeMessage *msg, GtkWidget *entry_widget, const gchar *type)
{
+ EDestination **destv;
CamelInternetAddress *addr;
- char *string;
+ char *string = NULL, *dest_str = NULL;
+ gint i=0;
bonobo_widget_get_property (BONOBO_WIDGET (entry_widget), "text", &string, NULL);
+ destv = e_destination_importv (string);
- addr = camel_internet_address_new ();
- camel_address_unformat (CAMEL_ADDRESS (addr), string);
+ if (destv) {
+
+ dest_str = e_destination_get_address_textv (destv);
+
+ if (dest_str) {
+ addr = camel_internet_address_new ();
+ camel_address_unformat (CAMEL_ADDRESS (addr), dest_str);
- /* 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 */
+ /* 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_mime_message_set_recipients (msg, type, addr);
- camel_object_unref (CAMEL_OBJECT (addr));
+ camel_object_unref (CAMEL_OBJECT (addr));
+
+ g_free (dest_str);
+ }
+
+ for (i=0; destv[i]; ++i)
+ gtk_object_unref (GTK_OBJECT (destv[i]));
+ g_free (destv);
+ }
+
g_free (string);
}