From 28d0aabbc86079bf3f70d86daf3362aae9dbf1ec Mon Sep 17 00:00:00 2001 From: David Woodhouse Date: Wed, 21 Jul 2010 15:09:34 +0100 Subject: [PATCH] Prepare for handling ModifiedOccurrences, by passing parent id and zone --- calitem_to_ical.c | 3 ++- ews2ical.c | 2 +- ews_syncfolder.c | 11 +++++++---- libews.h | 3 ++- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/calitem_to_ical.c b/calitem_to_ical.c index 06130e0..7967e72 100644 --- a/calitem_to_ical.c +++ b/calitem_to_ical.c @@ -49,7 +49,8 @@ gboolean process_reminder_mins(icalcomponent *comp, xmlNode *xmlnode, GError **e icaltimezone *get_timezone(xmlNode *xmlnode, GError **error); icaltimezone *get_meeting_timezone(xmlNode *xml_node, GError **error); -icalcomponent *ews_calitem_to_ical(xmlNode *xml_node, GError **error) +icalcomponent *ews_calitem_to_ical(xmlNode *xml_node, const gchar *parent_id, + icaltimezone *parent_zone, GError **error) { icaltimetype dtstart, dtend; icaltimetype *deletia = NULL; diff --git a/ews2ical.c b/ews2ical.c index c6dcd90..ab5e13d 100644 --- a/ews2ical.c +++ b/ews2ical.c @@ -129,7 +129,7 @@ int main(int argc, char **argv) return -1; } - calcomp = ews_calitem_to_ical(xml_node, &error); + calcomp = ews_calitem_to_ical(xml_node, NULL, NULL, &error); if (!calcomp) { fprintf(stderr, "Failed to convert: %s\n", error->message); diff --git a/ews_syncfolder.c b/ews_syncfolder.c index ac3ff24..1bfa02b 100644 --- a/ews_syncfolder.c +++ b/ews_syncfolder.c @@ -24,7 +24,8 @@ struct item_change { int process_changes(xmlNode *node, struct item_change **changes); int fetch_xml_item(SoupSession *sess, char *url, const char *itemid, - const char *xml_filename, const char *ics_filename); + const char *xml_filename, const char *ics_filename, + const char *parent_id, icaltimezone *parent_zone); struct ews_auth { const char *username; @@ -234,7 +235,8 @@ int main(int argc, char **argv) unlink(ics_filename); } else { if (fetch_xml_item(sess, url, this->itemid, - xml_filename, ics_filename)) + xml_filename, ics_filename, + NULL, NULL)) return -1; } changes = this->next; @@ -247,7 +249,8 @@ int main(int argc, char **argv) } int fetch_xml_item(SoupSession *sess, char *url, const char *itemid, - const char *xml_filename, const char *ics_filename) + const char *xml_filename, const char *ics_filename, + const char *parent_id, icaltimezone *parent_zone) { GError *error = NULL; SoupMessage *msg; @@ -392,7 +395,7 @@ int fetch_xml_item(SoupSession *sess, char *url, const char *itemid, exit (1); } - calcomp = ews_calitem_to_ical(node, &error); + calcomp = ews_calitem_to_ical(node, parent_id, parent_zone, &error); if (!calcomp) { printf("Failed to parse calendar: %s\n", error->message); g_clear_error(&error); diff --git a/libews.h b/libews.h index ee07c27..d969ba9 100644 --- a/libews.h +++ b/libews.h @@ -26,7 +26,8 @@ #include #include -icalcomponent *ews_calitem_to_ical(xmlNode *xml_node, GError **error); +icalcomponent *ews_calitem_to_ical(xmlNode *xml_node, const char *parent_id, + icaltimezone *parent_zone, GError **error); #define EWS_ERROR (ews_error_quark()) -- 2.50.1