aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--composer/ChangeLog6
-rw-r--r--composer/e-msg-composer.c27
2 files changed, 33 insertions, 0 deletions
diff --git a/composer/ChangeLog b/composer/ChangeLog
index b3a2052b6c..93e9d630a7 100644
--- a/composer/ChangeLog
+++ b/composer/ChangeLog
@@ -1,3 +1,9 @@
+2000-12-05 Jeffrey Stedfast <fejj@helixcode.com>
+
+ * e-msg-composer.c (add_recipients): Use camel to construct the
+ list of recipients rather than just strchr(recips, ',') which is
+ very prone to errors.
+
2000-11-03 Iain Holmes <iain@helixcode.com>
* e-msg-composer-attachment-bar.c (update): Pass NULL
diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c
index 80e6eaf357..6db5954871 100644
--- a/composer/e-msg-composer.c
+++ b/composer/e-msg-composer.c
@@ -1681,6 +1681,7 @@ e_msg_composer_new_with_message (CamelMimeMessage *msg)
return new;
}
+#if 0
static GList *
add_recipients (GList *list, const char *recips, gboolean decode)
{
@@ -1702,6 +1703,32 @@ add_recipients (GList *list, const char *recips, gboolean decode)
return list;
}
+#endif
+
+static GList *
+add_recipients (GList *list, const char *recips, gboolean decode)
+{
+ CamelInternetAddress *cia;
+ const char *name, *addr;
+ int num, i;
+
+ cia = camel_internet_address_new ();
+ if (decode)
+ num = camel_address_decode (CAMEL_ADDRESS (cia), recips);
+ else
+ num = camel_address_unformat (CAMEL_ADDRESS (cia), recips);
+
+ for (i = 0; i < num; i++) {
+ if (camel_internet_address_get (cia, i, &name, &addr)) {
+ char *str;
+
+ str = camel_internet_address_format_address (name, addr);
+ list = g_list_append (list, str);
+ }
+ }
+
+ return list;
+}
static void
free_recipients (GList *list)