]> www.infradead.org Git - users/dwmw2/ews-sync.git/commitdiff
Handle recursion
authorDavid Woodhouse <dwmw2@infradead.org>
Thu, 22 Jul 2010 16:00:09 +0000 (17:00 +0100)
committerDavid Woodhouse <dwmw2@infradead.org>
Thu, 22 Jul 2010 16:00:09 +0000 (17:00 +0100)
ews_syncfolder.c

index 6ce432448370a0c95a81ce8e6aefade9d090bf3d..b359ecce29fc0afd862e412cc0112d8f28a3dc7a 100644 (file)
@@ -274,10 +274,26 @@ int main(int argc, char **argv)
        return 0;
 }
 
+struct _state {
+       SoupSession *sess;
+       char *url;
+};
+
+icalcomponent *fetch_xml_subitem(void *_st, const char *itemid,
+                                const char *parent_id, icaltimezone *parent_zone, GError **error)
+{
+       struct _state *st = _st;
+       return fetch_xml_item(st->sess, st->url, itemid, NULL, parent_id, parent_zone, error);
+}
+
 icalcomponent *fetch_xml_item(SoupSession *sess, char *url, const char *itemid,
                              const char *xml_filename, const char *parent_id,
                              icaltimezone *parent_zone, GError **error)
 {
+       struct _state st = {
+               .sess = sess,
+               .url = url,
+       };
        SoupSoapMessage *msg;
        SoupSoapResponse *resp;
        xmlNode *node;
@@ -391,7 +407,7 @@ icalcomponent *fetch_xml_item(SoupSession *sess, char *url, const char *itemid,
                goto out;
        }
 
-       calcomp = ews_calitem_to_ical(node, parent_id, parent_zone, NULL, NULL, error);
+       calcomp = ews_calitem_to_ical(node, parent_id, parent_zone, fetch_xml_subitem, (void *)&st, error);
  out:
        g_object_unref(resp);