From 92a306d3a6b4ee9a94a6a8d7269771ed2b5c8f4b Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Sat, 6 Dec 2008 18:26:46 +0000 Subject: [PATCH] * Eliminated the ical_add() function, because it 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 | 47 ++---------------------- 1 file changed, 4 insertions(+), 43 deletions(-) diff --git a/citadel/modules/calendar/serv_calendar.c b/citadel/modules/calendar/serv_calendar.c index be7e47b68..a5e7f386d 100644 --- a/citadel/modules/calendar/serv_calendar.c +++ b/citadel/modules/calendar/serv_calendar.c @@ -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. */ -- 2.30.2