#ifdef HAVE_ICAL_H
#include <ical.h>
+#include "ical_dezonify.h"
struct ical_respond_data {
char desired_partnum[SIZ];
}
the_reply = icalcomponent_new_clone(request);
+ ical_dezonify(the_reply);
if (the_reply == NULL) {
lprintf(3, "ERROR: cannot clone request\n");
return;
}
if (strcasecmp(partnum, ird->desired_partnum)) return;
ird->cal = icalcomponent_new_from_string(content);
+ ical_dezonify(ird->cal);
}
icalcomponent_free(oec->c);
}
oec->c = icalcomponent_new_from_string(content);
+ ical_dezonify(oec->c);
}
/* Clone the reply, because we're going to rip its guts out. */
reply = icalcomponent_new_clone(reply);
+ ical_dezonify(reply);
/* At this point we're looking at the correct subcomponents.
* Iterate through the attendees looking for a match.
/*
* ical_send_out_invitations() is called by ical_saving_vevent() when it
- * finds a VEVENT. FIXME ... finish implementing.
+ * finds a VEVENT.
*/
void ical_send_out_invitations(icalcomponent *cal) {
icalcomponent *the_request = NULL;
struct CtdlMessage *msg = NULL;
struct recptypes *valid = NULL;
char attendees_string[SIZ];
+ int num_attendees = 0;
char this_attendee[SIZ];
icalproperty *attendee = NULL;
char summary_string[SIZ];
lprintf(3, "ERROR: cannot clone calendar object\n");
return;
}
+ ical_dezonify(the_request);
/* Extract the summary string -- we'll use it as the
* message subject for the request
"%s, ",
this_attendee
);
+ ++num_attendees;
}
}
}
- lprintf(9, "attendees_string: <%s>\n", attendees_string);
+ lprintf(9, "<%d> attendees: <%s>\n", num_attendees, attendees_string);
+
+ /* If there are no attendees, there are no invitations to send, so...
+ * don't bother putting one together! Punch out, Maverick!
+ */
+ if (num_attendees == 0) {
+ icalcomponent_free(the_request);
+ return;
+ }
/* Encapsulate the VEVENT component into a complete VCALENDAR */
encaps = icalcomponent_new(ICAL_VCALENDAR_COMPONENT);
*/
if (!strcasecmp(cbtype, "text/calendar")) {
cal = icalcomponent_new_from_string(content);
+ ical_dezonify(cal);
if (cal != NULL) {
p = ical_ctdl_get_subprop(cal, ICAL_UID_PROPERTY);
if (p != NULL) {
if (!strcasecmp(cbtype, "text/calendar")) {
cal = icalcomponent_new_from_string(content);
if (cal != NULL) {
+ ical_dezonify(cal);
ical_saving_vevent(cal);
icalcomponent_free(cal);
}