* Eliminated the ical_add() function, because it
authorArt Cancro <ajc@citadel.org>
Sat, 6 Dec 2008 18:26:46 +0000 (18:26 +0000)
committerArt Cancro <ajc@citadel.org>
Sat, 6 Dec 2008 18:26:46 +0000 (18:26 +0000)
  had been reduced down to one line of code and was
  no longer making sense as a separate function.

citadel/modules/calendar/serv_calendar.c

index be7e47b68008b2b8b4627fdaf901b4f21974ed98..a5e7f386dbeea85f9aff0346708b5b468ab20733 100644 (file)
@@ -161,45 +161,6 @@ void ical_write_to_cal(struct ctdluser *u, icalcomponent *cal) {
 }
 
 
-/*
- * Add a calendar object to the user's calendar
- * 
- * ok because it uses ical_write_to_cal()
- */
-void ical_add(icalcomponent *cal, int recursion_level) {
-       icalcomponent *c;
-
-#if 1
-       /* Write the whole thing because it may need to save timezones etc.
-        * FIXME - if this works, we can probably eliminate this entire function
-        */
-
-       ical_write_to_cal(&CC->user, cal);
-
-#else  /* this was the old code to kill everything but the VEVENT component ... probably ng now */
-
-       /*
-        * The VEVENT subcomponent is the one we're interested in saving.
-        */
-       if (icalcomponent_isa(cal) == ICAL_VEVENT_COMPONENT) {
-       
-               ical_write_to_cal(&CC->user, cal);
-
-       }
-
-       /* If the component has subcomponents, recurse through them. */
-       for (c = icalcomponent_get_first_component(cal, ICAL_ANY_COMPONENT);
-           (c != 0);
-           c = icalcomponent_get_next_component(cal, ICAL_ANY_COMPONENT)) {
-               /* Recursively process subcomponent */
-               ical_add(c, recursion_level+1);
-       }
-#endif
-
-}
-
-
-
 /*
  * Send a reply to a meeting invitation.
  *
@@ -437,7 +398,7 @@ void ical_respond(long msgnum, char *partnum, char *action) {
        if (ird.cal != NULL) {
                /* Save this in the user's calendar if necessary */
                if (!strcasecmp(action, "accept")) {
-                       ical_add(ird.cal, 0);
+                       ical_write_to_cal(&CC->user, ird.cal);
                }
 
                /* Send a reply if necessary */
@@ -445,9 +406,9 @@ void ical_respond(long msgnum, char *partnum, char *action) {
                        ical_send_a_reply(ird.cal, action);
                }
 
-               /* Now that we've processed this message, we don't need it
-                * anymore.  So delete it.  (NOTE we don't do this anymore.)
-               CtdlDeleteMessages(CC->room.QRname, &msgnum, 1, "");
+               /* We used to delete the invitation after handling it.
+                * We don't do that anymore, but here is the code that handled it:
+                * CtdlDeleteMessages(CC->room.QRname, &msgnum, 1, "");
                 */
 
                /* Free the memory we allocated and return a response. */