aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libical/ChangeLog6
-rw-r--r--libical/src/libical/icaltimezone.c20
2 files changed, 25 insertions, 1 deletions
diff --git a/libical/ChangeLog b/libical/ChangeLog
index 1ed7a708b1..2b5a735339 100644
--- a/libical/ChangeLog
+++ b/libical/ChangeLog
@@ -1,3 +1,9 @@
+2001-12-10 Damon Chaplin <damon@ximian.com>
+
+ * src/libical/icaltimezone.c (icaltimezone_get_display_name): if all
+ we have is the TZID, see if it is one of our TZIDs and if so get the
+ city name out of it. Fixes bug #16571.
+
2001-11-13 Damon Chaplin <damon@ximian.com>
* src/libical/icaltimezone.c (icaltimezone_get_tzid): initialize the
diff --git a/libical/src/libical/icaltimezone.c b/libical/src/libical/icaltimezone.c
index f2e33d3596..6303bec2f1 100644
--- a/libical/src/libical/icaltimezone.c
+++ b/libical/src/libical/icaltimezone.c
@@ -1226,8 +1226,26 @@ icaltimezone_get_display_name (icaltimezone *zone)
display_name = icaltimezone_get_location (zone);
if (!display_name)
display_name = icaltimezone_get_tznames (zone);
- if (!display_name)
+ if (!display_name) {
display_name = icaltimezone_get_tzid (zone);
+ /* Outlook will strip out X-LIC-LOCATION property and so all
+ we get back in the iTIP replies is the TZID. So we see if
+ this is one of our TZIDs and if so we jump to the city name
+ at the end of it. */
+ if (display_name
+ && !strncmp (display_name, TZID_PREFIX, TZID_PREFIX_LEN)) {
+ /* Get the location, which is after the 3rd '/' char. */
+ char *p;
+ int num_slashes = 0;
+ for (p = display_name; *p; p++) {
+ if (*p == '/') {
+ num_slashes++;
+ if (num_slashes == 3)
+ return p + 1;
+ }
+ }
+ }
+ }
return display_name;
}