]> code.citadel.org Git - citadel.git/blobdiff - webcit/ical_dezonify.c
* move some more vars from the session context to strbuf (the use of StrBufAppendTemp...
[citadel.git] / webcit / ical_dezonify.c
index ff501519d244d4fea49a6342fa1659cf156414a2..044825592e4d213c0eeda42f6149c55a74eb96b1 100644 (file)
@@ -13,7 +13,6 @@
 #include "webcit.h"
 #include "webserver.h"
 
-
 /*
  * Figure out which time zone needs to be used for timestamps that are
  * not UTC and do not have a time zone specified.
@@ -22,7 +21,7 @@
 icaltimezone *get_default_icaltimezone(void) {
 
         icaltimezone *zone = NULL;
-       char *default_zone_name = serv_info.serv_default_cal_zone;
+       const char *default_zone_name = ChrPtr(serv_info.serv_default_cal_zone);
 
         if (!zone) {
                 zone = icaltimezone_get_builtin_timezone(default_zone_name);
@@ -77,12 +76,22 @@ void ical_dezonify_backend(icalcomponent *cal,
 #endif
                        }
                        else {
+                               /* try attached first */
                                t = icalcomponent_get_timezone(cal, tzid);
 #ifdef DBG_ICAL
                                lprintf(9, "                * ...and I %s have tzdata for that zone.\n",
                                        (t ? "DO" : "DO NOT")
                                );
 #endif
+                               /* then try built-in timezones */
+                               if (!t) {
+                                       t = icaltimezone_get_builtin_timezone(tzid);
+#ifdef DBG_ICAL
+                                       if (t) {
+                                               lprintf(9, "                * Using system tzdata!\n");
+                                       }
+#endif
+                               }
                        }
                }