aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
Diffstat (limited to 'mail')
-rw-r--r--mail/ChangeLog13
-rw-r--r--mail/upgrade-mailer.c35
2 files changed, 33 insertions, 15 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 0f598dbd22..21d2e336af 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,16 @@
+2002-09-08 Dan Winship <danw@ximian.com>
+
+ * upgrade-mailer.c (exchange_url_upgrade): Don't modify the URL if
+ the path doesn't start with "exchange". (Means it's already a 1.2
+ URL.)
+ (shortcuts_upgrade_uri): Need to hex-decode exchange URLs here too.
+ (shortcuts_upgrade_xml_file): Fix an off-by-one error here (twice)
+ so it actually works instead of always claiming shortcuts.xml
+ doesn't need to be upgraded.
+ (mailer_upgrade): Check the size of the accounts hash rather than
+ imap_sources since we have work to do if the user has an exchange
+ account but no imap accounts.
+
2002-09-06 Jeffrey Stedfast <fejj@ximian.com>
* upgrade-mailer.c (upgrade): Sync the database after upgrading
diff --git a/mail/upgrade-mailer.c b/mail/upgrade-mailer.c
index 9ce20522dc..15d0ed242e 100644
--- a/mail/upgrade-mailer.c
+++ b/mail/upgrade-mailer.c
@@ -365,13 +365,14 @@ exchange_url_upgrade (const char *uri)
base_url = get_base_url ("exchange", uri);
folder = (unsigned char *) uri + strlen (base_url) + 1;
- if (!strncmp (folder, "exchange/", 9)) {
- folder += 9;
- while (*folder && *folder != '/')
- folder++;
- if (*folder == '/')
- folder++;
- }
+ if (strncmp (folder, "exchange/", 9))
+ return g_strdup (uri);
+
+ folder += 9;
+ while (*folder && *folder != '/')
+ folder++;
+ if (*folder == '/')
+ folder++;
folder = hex_decode (folder, strlen (folder));
url = g_strdup_printf ("%s/personal/%s", base_url, folder);
@@ -597,13 +598,17 @@ static char *
shortcuts_upgrade_uri (GHashTable *accounts, GHashTable *imap_sources, const char *account, const char *folder)
{
struct _storeinfo *si;
- char *url, *new;
+ char *url, *new, *decoded;
int type;
type = GPOINTER_TO_INT ((si = g_hash_table_lookup (accounts, account)));
if (type == 1) {
/* exchange */
- return g_strdup_printf ("personal/%s", folder);
+ decoded = hex_decode (folder, strlen (folder));
+ new = g_strdup_printf ("personal/%s", decoded);
+ g_free (decoded);
+
+ return new;
} else {
/* imap */
url = g_strdup_printf ("%s/%s", si->base_url, folder);
@@ -673,9 +678,9 @@ shortcuts_upgrade_xml_file (GHashTable *accounts, GHashTable *imap_sources, cons
url_need_upgrade = FALSE;
do {
g_free (account);
- inptr = strstr (inptr, ">evolution:");
+ inptr = strstr (inptr, ">evolution:/");
if (inptr) {
- inptr += 11;
+ inptr += 12;
account = inptr;
while (*inptr && *inptr != '/')
inptr++;
@@ -757,9 +762,9 @@ shortcuts_upgrade_xml_file (GHashTable *accounts, GHashTable *imap_sources, cons
url_need_upgrade = FALSE;
do {
g_free (account);
- inptr = strstr (inptr, ">evolution:");
+ inptr = strstr (inptr, ">evolution:/");
if (inptr) {
- inptr += 11;
+ inptr += 12;
account = inptr;
while (*inptr && *inptr != '/')
inptr++;
@@ -894,8 +899,8 @@ mailer_upgrade (Bonobo_ConfigDatabase db)
g_free (uri);
}
- if (g_hash_table_size (imap_sources) == 0) {
- /* user doesn't have any imap accounts - nothing to upgrade */
+ if (g_hash_table_size (accounts) == 0) {
+ /* user doesn't have any imap/exchange accounts - nothing to upgrade */
g_hash_table_destroy (imap_sources);
return 0;
}