aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mail/ChangeLog6
-rw-r--r--mail/mail-config.c35
2 files changed, 34 insertions, 7 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 4d80c8986a..b297f0614e 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,5 +1,11 @@
2001-09-28 Jeffrey Stedfast <fejj@ximian.com>
+ * 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 <fejj@ximian.com>
+
* mail-local.c (mail_local_provider_init): Setup the url_hash and
url_equal functions for the local provider.
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;
}