diff options
author | Jeffrey Stedfast <fejj@helixcode.com> | 2000-12-06 07:10:32 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2000-12-06 07:10:32 +0800 |
commit | 3c7be1018d11ef211d89929eb566a6059b869fd6 (patch) | |
tree | 31e610f7abb3b71df1a69c8ae415fddded09b4fe /composer | |
parent | efeeb1bd1fcc957193b4e65f825983abdd2744f7 (diff) | |
download | gsoc2013-evolution-3c7be1018d11ef211d89929eb566a6059b869fd6.tar gsoc2013-evolution-3c7be1018d11ef211d89929eb566a6059b869fd6.tar.gz gsoc2013-evolution-3c7be1018d11ef211d89929eb566a6059b869fd6.tar.bz2 gsoc2013-evolution-3c7be1018d11ef211d89929eb566a6059b869fd6.tar.lz gsoc2013-evolution-3c7be1018d11ef211d89929eb566a6059b869fd6.tar.xz gsoc2013-evolution-3c7be1018d11ef211d89929eb566a6059b869fd6.tar.zst gsoc2013-evolution-3c7be1018d11ef211d89929eb566a6059b869fd6.zip |
Use camel to construct the list of recipients rather than just
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.
svn path=/trunk/; revision=6802
Diffstat (limited to 'composer')
-rw-r--r-- | composer/ChangeLog | 6 | ||||
-rw-r--r-- | composer/e-msg-composer.c | 27 |
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) |