]> code.citadel.org Git - citadel.git/blobdiff - webcit/calendar_tools.c
Log an error message when ical_encapsulate_subcomponent() is
[citadel.git] / webcit / calendar_tools.c
index cbcda4362dcbe266988f0d7c6de3a26130d795b9..07faad27ba6dd5b5697902adfd12703898586a9e 100644 (file)
@@ -179,11 +179,8 @@ void icaltime_from_webform_dateonly(struct icaltimetype *t, char *prefix) {
 }
 
 
-/**
- * \brief Render PARTSTAT
+/*
  * Render a PARTSTAT parameter as a string (and put it in parentheses)
- * \param buf the string to put it to
- * \param attendee the attendee to textify
  */
 void partstat_as_string(char *buf, icalproperty *attendee) {
        icalparameter *partstat_param;
@@ -238,26 +235,23 @@ void partstat_as_string(char *buf, icalproperty *attendee) {
 icalcomponent *ical_encapsulate_subcomponent(icalcomponent *subcomp) {
        icalcomponent *encaps;
 
-       /* lprintf(9, "ical_encapsulate_subcomponent() called\n"); */
-
        if (subcomp == NULL) {
-               lprintf(3, "ERROR: called with NULL argument!\n");
+               lprintf(3, "ERROR: ical_encapsulate_subcomponent() called with NULL argument\n");
                return NULL;
        }
 
        /*
-        * If we're already looking at a full VCALENDAR component,
-        * don't bother ... just return itself.
+        * If we're already looking at a full VCALENDAR component, this is probably an error.
         */
        if (icalcomponent_isa(subcomp) == ICAL_VCALENDAR_COMPONENT) {
+               lprintf(3, "ERROR: component sent to ical_encapsulate_subcomponent() already top level\n");
                return subcomp;
        }
 
        /* Encapsulate the VEVENT component into a complete VCALENDAR */
        encaps = icalcomponent_new(ICAL_VCALENDAR_COMPONENT);
        if (encaps == NULL) {
-               lprintf(3, "%s:%d: Error - could not allocate component!\n",
-                       __FILE__, __LINE__);
+               lprintf(3, "ERROR: ical_encapsulate_subcomponent() could not allocate component\n");
                return NULL;
        }
 
@@ -268,14 +262,8 @@ icalcomponent *ical_encapsulate_subcomponent(icalcomponent *subcomp) {
        icalcomponent_add_property(encaps, icalproperty_new_version("2.0"));
 
        /* Encapsulate the subcomponent inside */
-       /* lprintf(9, "Doing the encapsulation\n"); */
        icalcomponent_add_component(encaps, subcomp);
 
-       /* Convert all timestamps to UTC so we don't have to deal with
-        * stupid VTIMEZONE crap.
-        */
-       ical_dezonify(encaps);
-
        /* Return the object we just created. */
        return(encaps);
 }