Applied patch submitted by Matt for empty field checking in calendar items
authorArt Cancro <ajc@citadel.org>
Mon, 22 May 2006 02:40:03 +0000 (02:40 +0000)
committerArt Cancro <ajc@citadel.org>
Mon, 22 May 2006 02:40:03 +0000 (02:40 +0000)
webcit/README.txt
webcit/event.c

index 9ffbe4df24a73de1385fdd8aa603ef81910c5cb9..2a34a988247fa93dcf9037a4d3c96ec4f8eff93c 100644 (file)
@@ -9,6 +9,7 @@
        Nick Grossman
        Andru Luvisi
        Dave Lindquist
+       Matthew McBride
        Martin Mouritzen
 
    This program is open source software released under the terms of the GNU
index 94fac68dbc9d4188cfea0eb40d42ff7728083431..3490b79fbb79494954d74db3a407c9cc64932e77 100644 (file)
@@ -459,25 +459,35 @@ void save_individual_event(icalcomponent *supplied_vevent, long msgnum) {
                        icalcomponent_remove_property(vevent, prop);
                        icalproperty_free(prop);
                }
-               icalcomponent_add_property(vevent,
-                       icalproperty_new_summary(bstr("summary")));
 
-               while (prop = icalcomponent_get_first_property(vevent,
-                     ICAL_LOCATION_PROPERTY), prop != NULL) {
-                       icalcomponent_remove_property(vevent, prop);
-                       icalproperty_free(prop);
-               }
-               icalcomponent_add_property(vevent,
-                       icalproperty_new_location(bstr("location")));
-               
-               while (prop = icalcomponent_get_first_property(vevent,
-                     ICAL_DESCRIPTION_PROPERTY), prop != NULL) {
-                       icalcomponent_remove_property(vevent, prop);
-                       icalproperty_free(prop);
-               }
-               icalcomponent_add_property(vevent,
-                       icalproperty_new_description(bstr("description")));
+               if (strlen(bstr("summary")) > 0) {
+       
+                       icalcomponent_add_property(vevent,
+                                       icalproperty_new_summary(bstr("summary")));
+               } else {
+                       icalcomponent_add_property(vevent,
+                                       icalproperty_new_summary("Untitled Event"));
+               }
        
+               while (prop = icalcomponent_get_first_property(vevent,
+                                       ICAL_LOCATION_PROPERTY), prop != NULL) {
+                       icalcomponent_remove_property(vevent, prop);
+                       icalproperty_free(prop);
+               }
+               if (strlen(bstr("location")) > 0) {
+                       icalcomponent_add_property(vevent,
+                                       icalproperty_new_location(bstr("location")));
+               }
+               while (prop = icalcomponent_get_first_property(vevent,
+                                 ICAL_DESCRIPTION_PROPERTY), prop != NULL) {
+                       icalcomponent_remove_property(vevent, prop);
+                       icalproperty_free(prop);
+               }
+               if (strlen(bstr("description")) > 0) {
+                       icalcomponent_add_property(vevent,
+                               icalproperty_new_description(bstr("description")));
+               }
+
                while (prop = icalcomponent_get_first_property(vevent,
                      ICAL_DTSTART_PROPERTY), prop != NULL) {
                        icalcomponent_remove_property(vevent, prop);
@@ -594,7 +604,7 @@ void save_individual_event(icalcomponent *supplied_vevent, long msgnum) {
                        /** set new organizer */
                        sprintf(organizer_string, "MAILTO:%s", buf);
                        icalcomponent_add_property(vevent,
-                               icalproperty_new_organizer(organizer_string)
+                               icalproperty_new_organizer(organizer_string)
                        );
 
                }