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/e-msg-composer.c | |
parent | efeeb1bd1fcc957193b4e65f825983abdd2744f7 (diff) | |
download | gsoc2013-evolution-3c7be1018d11ef211d89929eb566a6059b869fd6.tar.gz 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/e-msg-composer.c')
-rw-r--r-- | composer/e-msg-composer.c | 27 |
1 files changed, 27 insertions, 0 deletions
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) |