From: Art Cancro Date: Tue, 1 Jan 2008 16:19:13 +0000 (+0000) Subject: More verbose logging for get_default_icaltimezone() when it X-Git-Tag: v7.86~2627 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=df5a2fc29b002c29981d98e483c51658e3b6ad45 More verbose logging for get_default_icaltimezone() when it fails to retrieve built in time zones. This is for the purpose of troubleshooting a bug which has appeared in libical. --- diff --git a/citadel/ical_dezonify.c b/citadel/ical_dezonify.c index 4a7de0715..70a28600d 100644 --- a/citadel/ical_dezonify.c +++ b/citadel/ical_dezonify.c @@ -32,16 +32,24 @@ * Figure out which time zone needs to be used for timestamps that are * not UTC and do not have a time zone specified. */ -icaltimezone *get_default_icaltimezone(void) -{ +icaltimezone *get_default_icaltimezone(void) { + icaltimezone *zone = NULL; + char *default_zone_name = config.c_default_cal_zone; + //char *default_zone_name = "America/New_York"; - if (!zone) { - zone = icaltimezone_get_builtin_timezone(config.c_default_cal_zone); - } if (!zone) { + zone = icaltimezone_get_builtin_timezone(default_zone_name); + } + if (!zone) { + lprintf(CTDL_ALERT, + "Unable to load '%s' time zone. Defaulting to UTC.\n", + default_zone_name); zone = icaltimezone_get_utc_timezone(); } + if (!zone) { + lprintf(1, "Unable to load UTC time zone!\n"); + } return zone; } diff --git a/citadel/modules/imap/serv_imap.c b/citadel/modules/imap/serv_imap.c index 4f63c04e3..d931ca144 100644 --- a/citadel/modules/imap/serv_imap.c +++ b/citadel/modules/imap/serv_imap.c @@ -1234,6 +1234,7 @@ void imap_rename(int num_parms, char *parms[]) struct irl *irl = NULL; /* the list */ struct irl *irlp = NULL; /* scratch pointer */ struct irlparms irlparms; + char buf[1024]; if (strchr(parms[3], '\\') != NULL) { cprintf("%s NO Invalid character in folder name\r\n", @@ -1275,7 +1276,6 @@ void imap_rename(int num_parms, char *parms[]) return; } - /* If this is the INBOX, then RFC2060 says we have to just move the * contents. In a Citadel environment it's easier to rename the room * (already did that) and create a new inbox. @@ -1306,6 +1306,13 @@ void imap_rename(int num_parms, char *parms[]) } } + snprintf(buf, sizeof buf, "IMAP folder \"%s\" renamed to \"%s\" by %s\n", + parms[2], + parms[3], + CC->curr_user + ); + aide_message(buf, "IMAP folder rename"); + cprintf("%s OK RENAME completed\r\n", parms[0]); } diff --git a/webcit/ical_dezonify.c b/webcit/ical_dezonify.c index afcd17d11..7d1ed5b0d 100644 --- a/webcit/ical_dezonify.c +++ b/webcit/ical_dezonify.c @@ -25,13 +25,18 @@ icaltimezone *get_default_icaltimezone(void) { icaltimezone *zone = NULL; + char *default_zone_name = serv_info.serv_default_cal_zone; if (!zone) { - zone = icaltimezone_get_builtin_timezone(serv_info.serv_default_cal_zone); + zone = icaltimezone_get_builtin_timezone(default_zone_name); } if (!zone) { + lprintf(1, "Unable to load '%s' time zone. Defaulting to UTC.\n", default_zone_name); zone = icaltimezone_get_utc_timezone(); } + if (!zone) { + lprintf(1, "Unable to load UTC time zone!\n"); + } return zone; }