From: David Woodhouse Date: Mon, 19 Jul 2010 08:05:52 +0000 (+0100) Subject: Complain loudly about recurrence with no time zone X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=8e8757e7327dee61b2e5b07c2fddb0e10ba86e29;p=users%2Fdwmw2%2Fews-sync.git Complain loudly about recurrence with no time zone --- diff --git a/ews2ical.c b/ews2ical.c index 410aa29..b1918e1 100644 --- a/ews2ical.c +++ b/ews2ical.c @@ -31,7 +31,7 @@ int process_end(icalcomponent *comp, xmlNode *xml_node, icaltimezone *zone); int process_location(icalcomponent *comp, xmlNode *xml_node); int process_body(icalcomponent *comp, xmlNode *xml_node); int process_subject(icalcomponent *comp, xmlNode *xml_node); -int process_recurrence(icalcomponent *comp, xmlNode *xml_node); +int process_recurrence(icalcomponent *comp, xmlNode *xml_node, icaltimezone *zone); int process_itemid(icalcomponent *comp, xmlNode *xmlnode); int process_reminder_mins(icalcomponent *comp, xmlNode *xmlnode); icaltimezone *get_timezone(xmlNode *xmlnode); @@ -190,7 +190,7 @@ icalcomponent *ews_calitem_to_ical(xmlNode *xml_node) else if (!strcmp((char *)xml_node->name, "Subject")) process_subject(comp, xml_node); else if (!strcmp((char *)xml_node->name, "Recurrence")) - process_recurrence(comp, xml_node); + process_recurrence(comp, xml_node, icaltz); else if (!strcmp((char *)xml_node->name, "ItemId")) process_itemid(comp, xml_node); else if (!strcmp((char *)xml_node->name, "ReminderMinutesBeforeStart")) @@ -473,7 +473,7 @@ static int weekindex_to_ical(const char *week) return 0; } -int process_recurrence(icalcomponent *comp, xmlNode *xml_node) +int process_recurrence(icalcomponent *comp, xmlNode *xml_node, icaltimezone *zone) { struct icalrecurrencetype ical_recur; char *end_date = NULL, *nr_occurrences = NULL; @@ -481,7 +481,9 @@ int process_recurrence(icalcomponent *comp, xmlNode *xml_node) xmlNode *xml_node2; ical_recur.freq = ICAL_NO_RECURRENCE; - + if (!zone) + fprintf(stderr, "Recurrence with no recognised TimeZone. Hope this is an all-day event\n"); + for (xml_node = xml_node->children; xml_node; xml_node = xml_node->next) { if (xml_node->type != XML_ELEMENT_NODE) continue;