From e023c17d5c4585474511f657bd3fcac1ee8963e3 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Fri, 28 Sep 2001 22:48:31 +0000 Subject: Use Camel to compare the urls rather than using e_url_equal which does all 2001-09-28 Jeffrey Stedfast * mail-config.c (mail_config_get_account_by_transport_url): Use Camel to compare the urls rather than using e_url_equal which does all sorts of funky shit that may not work in every case. svn path=/trunk/; revision=13239 --- mail/ChangeLog | 6 ++++++ mail/mail-config.c | 35 ++++++++++++++++++++++++++++------- 2 files changed, 34 insertions(+), 7 deletions(-) (limited to 'mail') diff --git a/mail/ChangeLog b/mail/ChangeLog index 4d80c8986a..b297f0614e 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,9 @@ +2001-09-28 Jeffrey Stedfast + + * mail-config.c (mail_config_get_account_by_transport_url): Use + Camel to compare the urls rather than using e_url_equal which does + all sorts of funky shit that may not work in every case. + 2001-09-28 Jeffrey Stedfast * mail-local.c (mail_local_provider_init): Setup the url_hash and diff --git a/mail/mail-config.c b/mail/mail-config.c index 512a760034..7372f664e3 100644 --- a/mail/mail-config.c +++ b/mail/mail-config.c @@ -1466,22 +1466,43 @@ const MailConfigAccount * mail_config_get_account_by_transport_url (const char *transport_url) { const MailConfigAccount *account; + CamelProvider *provider; + CamelURL *transport; GSList *l; - + g_return_val_if_fail (transport_url != NULL, NULL); - + + provider = camel_session_get_provider (session, transport_url, NULL); + if (!provider) + return NULL; + + transport = camel_url_new (transport_url, NULL); + if (!transport) + return NULL; + l = config->accounts; while (l) { account = l->data; - if (account - && account->transport - && account->transport->url - && e_url_equal (account->transport->url, transport_url)) - return account; + + if (account && account->transport && account->transport->url) { + CamelURL *url; + + url = camel_url_new (account->transport->url, NULL); + if (url && provider->url_equal (url, transport)) { + camel_url_free (url); + camel_url_free (transport); + return account; + } + + if (url) + camel_url_free (url); + } l = l->next; } + camel_url_free (transport); + return NULL; } -- cgit v1.2.3