From 9786b8ab7d75e20d28b7b3f91b403d21a28fd3cf Mon Sep 17 00:00:00 2001 From: Damon Chaplin Date: Mon, 10 Dec 2001 19:15:40 +0000 Subject: if all we have is the TZID, see if it is one of our TZIDs and if so get 2001-12-10 Damon Chaplin * 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. svn path=/trunk/; revision=14957 --- libical/ChangeLog | 6 ++++++ libical/src/libical/icaltimezone.c | 20 +++++++++++++++++++- 2 files changed, 25 insertions(+), 1 deletion(-) 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 + + * 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 * 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; } -- cgit