diff options
-rw-r--r-- | camel/ChangeLog | 8 | ||||
-rw-r--r-- | camel/camel-internet-address.c | 5 | ||||
-rw-r--r-- | camel/camel-internet-address.h | 5 | ||||
-rw-r--r-- | camel/providers/smtp/camel-smtp-transport.c | 56 |
4 files changed, 42 insertions, 32 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog index c516eaf6c4..386b32f62e 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,4 +1,12 @@ 2000-05-09 Jeffrey Stedfast <fejj@stampede.org> + * camel-internet-address.[c,h]: Undid my changes (moved + struct _address back into came-internet-address.c) + * providers/smtp/camel-smtp-transport.c: (_send): changed + from using it's own address manipulation (using struct _address) + to using camel_internet_address_get(). Also some format changes + to keep consistant with the rest of Camel + +2000-05-09 Jeffrey Stedfast <fejj@stampede.org> * camel-internet-address.[c,h]: Moved struct _address from camel-internet-address.c to camel-internet-address.h diff --git a/camel/camel-internet-address.c b/camel/camel-internet-address.c index 49b94d8b9c..fdf790dfd5 100644 --- a/camel/camel-internet-address.c +++ b/camel/camel-internet-address.c @@ -30,6 +30,11 @@ static void camel_internet_address_init (CamelInternetAddress *obj); static CamelAddressClass *camel_internet_address_parent; +struct _address { + char *name; + char *address; +}; + enum SIGNALS { LAST_SIGNAL }; diff --git a/camel/camel-internet-address.h b/camel/camel-internet-address.h index d817a2e7cd..14fbd5436a 100644 --- a/camel/camel-internet-address.h +++ b/camel/camel-internet-address.h @@ -39,11 +39,6 @@ struct _CamelInternetAddressClass { CamelAddressClass parent_class; }; -struct _address { - char *name; - char *address; -}; - guint camel_internet_address_get_type (void); CamelInternetAddress *camel_internet_address_new (void); diff --git a/camel/providers/smtp/camel-smtp-transport.c b/camel/providers/smtp/camel-smtp-transport.c index a19e1903c6..a240ae95ec 100644 --- a/camel/providers/smtp/camel-smtp-transport.c +++ b/camel/providers/smtp/camel-smtp-transport.c @@ -281,7 +281,7 @@ _send_to (CamelTransport *transport, CamelMedium *message, sender = smtp_get_email_addr_from_text(s); smtp_mail(smtp_transport, sender, ex); g_free(sender); - g_free(s); + g_free(s); if (!(len = g_list_length(recipients))) { camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, @@ -311,38 +311,40 @@ static gboolean _send (CamelTransport *transport, CamelMedium *message, CamelException *ex) { - const CamelInternetAddress *to, *cc, *bcc; + const CamelInternetAddress *to, *cc, *bcc; GList *recipients = NULL; - struct _address *addr; - guint index, len; + guint index, len; to = camel_mime_message_get_recipients ((CamelMimeMessage *) message, CAMEL_RECIPIENT_TYPE_TO); cc = camel_mime_message_get_recipients ((CamelMimeMessage *) message, CAMEL_RECIPIENT_TYPE_CC); bcc = camel_mime_message_get_recipients ((CamelMimeMessage *) message, CAMEL_RECIPIENT_TYPE_BCC); - /* get all of the To addresses into our recipient list */ - len = ((CamelAddress *)to)->addresses->len; - for (index = 0; index < len; index++) - { - addr = g_ptr_array_index( ((CamelAddress *)to)->addresses, index); - recipients = g_list_append(recipients, g_strdup(addr->address)); - } - - /* get all of the Cc addresses into our recipient list */ - len = ((CamelAddress *)cc)->addresses->len; - for (index = 0; index < len; index++) - { - addr = g_ptr_array_index( ((CamelAddress *)cc)->addresses, index); - recipients = g_list_append(recipients, g_strdup(addr->address)); - } - - /* get all of the Bcc addresses into our recipient list */ - len = ((CamelAddress *)bcc)->addresses->len; - for (index = 0; index < len; index++) - { - addr = g_ptr_array_index( ((CamelAddress *)bcc)->addresses, index); - recipients = g_list_append(recipients, g_strdup(addr->address)); - } + /* get all of the To addresses into our recipient list */ + len = ((CamelAddress *)to)->addresses->len; + for (index = 0; index < len; index++) { + const char *addr; + + if (camel_internet_address_get(to, index, NULL, &addr)) + recipients = g_list_append(recipients, g_strdup(addr)); + } + + /* get all of the Cc addresses into our recipient list */ + len = ((CamelAddress *)cc)->addresses->len; + for (index = 0; index < len; index++) { + const char *addr; + + if (camel_internet_address_get(cc, index, NULL, &addr)) + recipients = g_list_append(recipients, g_strdup(addr)); + } + + /* get all of the Bcc addresses into our recipient list */ + len = ((CamelAddress *)bcc)->addresses->len; + for (index = 0; index < len; index++) { + const char *addr; + + if (camel_internet_address_get(bcc, index, NULL, &addr)) + recipients = g_list_append(recipients, g_strdup(addr)); + } return _send_to (transport, message, recipients, ex); } |