#include "citadel.h"
#include "server.h"
#include "citserver.h"
-#include "sysdep_decls.h"
#include "support.h"
#include "config.h"
-#include "serv_extensions.h"
#include "user_ops.h"
#include "room_ops.h"
#include "tools.h"
#include "internet_addressing.h"
#include "serv_calendar.h"
#include "euidindex.h"
+#include "ctdl_module.h"
#ifdef CITADEL_WITH_CALENDAR_SERVICE
#include <ical.h>
#include "ical_dezonify.h"
+
+
struct ical_respond_data {
char desired_partnum[SIZ];
icalcomponent *cal;
if (me_attend) icalproperty_free(me_attend);
me_attend = icalproperty_new_clone(attendee);
}
- free(recp);
+ free_recipients(recp);
}
}
}
"", /* cc */
CC->room.QRname, 0, FMT_RFC822,
"",
+ "",
summary_string, /* Use summary for subject */
NULL,
reply_message_text);
valid = validate_recipients(organizer_string);
CtdlSubmitMsg(msg, valid, "");
CtdlFreeMessage(msg);
+ free_recipients(valid);
}
}
free(serialized_reply);
}
/* Now that we've processed this message, we don't need it
- * anymore. So delete it.
- */
+ * anymore. So delete it. (NOTE we don't do this anymore.)
CtdlDeleteMessages(CC->room.QRname, &msgnum, 1, "");
+ */
/* Free the memory we allocated and return a response. */
icalcomponent_free(ird.cal);
roomname,
0, FMT_RFC822,
"",
+ "",
"", /* no subject */
NULL,
message_text);
}
/* Now that we've processed this message, we don't need it
- * anymore. So delete it. (Maybe make this optional?)
- */
+ * anymore. So delete it. (Don't do this anymore.)
CtdlDeleteMessages(CC->room.QRname, &msgnum, 1, "");
+ */
/* Free the memory we allocated and return a response. */
icalcomponent_free(ird.cal);
cprintf("%d Conflicting events:\n", LISTING_FOLLOWS);
- /* FIXME CONNECTOR DEV -- we need to handle calendar items embedded inside multipart */
- CtdlForEachMessage(MSGS_ALL, 0, NULL, "^[Tt][Ee][Xx][Tt]/[Cc][Aa][Ll][Ee][Nn][Dd][Aa][Rr]$",
+ CtdlForEachMessage(MSGS_ALL, 0, NULL,
+ NULL,
NULL,
ical_hunt_for_conflicts_backend,
(void *) cal
if (recp->num_local == 1) {
found_user = getuser(&usbuf, recp->recp_local);
}
- free(recp);
+ free_recipients(recp);
}
}
if (recp->num_local == 1) {
found_user = getuser(&usbuf, recp->recp_local);
}
- free(recp);
+ free_recipients(recp);
}
}
if (recp->num_local == 1) {
found_user = getuser(&usbuf, recp->recp_local);
}
- free(recp);
+ free_recipients(recp);
}
}
}
/* Add busy time from events */
lprintf(CTDL_DEBUG, "Adding busy time from events\n");
- /* FIXME CONNECTOR DEV -- we need to handle calendar items embedded inside multipart */
- CtdlForEachMessage(MSGS_ALL, 0, NULL, "^[Tt][Ee][Xx][Tt]/[Cc][Aa][Ll][Ee][Nn][Dd][Aa][Rr]$",
- NULL, ical_freebusy_backend, (void *)fb
- );
+ CtdlForEachMessage(MSGS_ALL, 0, NULL, NULL, NULL, ical_freebusy_backend, (void *)fb );
/* If values for DTSTART and DTEND are still not present, set them
* to yesterday and tomorrow as default values.
/* Set the Version Number */
icalcomponent_add_property(encaps, icalproperty_new_version("2.0"));
- /* Set the method to REQUEST */
+ /* Set the method to PUBLISH */
icalcomponent_set_method(encaps, ICAL_METHOD_PUBLISH);
/* Now go through the room encapsulating all calendar items. */
- /* FIXME CONNECTOR DEV -- we need to handle calendar items embedded inside multipart */
CtdlForEachMessage(MSGS_ALL, 0, NULL,
- "^[Tt][Ee][Xx][Tt]/[Cc][Aa][Ll][Ee][Nn][Dd][Aa][Rr]$",
+ NULL,
NULL,
ical_getics_backend,
(void *) encaps
"", /* No single recipient here */
CC->room.QRname, 0, FMT_RFC822,
"",
+ "",
summary_string, /* Use summary for subject */
NULL,
request_message_text);
valid = validate_recipients(attendees_string);
CtdlSubmitMsg(msg, valid, "");
CtdlFreeMessage(msg);
- free (valid);
+ free_recipients(valid);
}
}
free(serialized_request);
* Send out invitations if, and only if, this user is the Organizer.
*/
if (icalcomponent_isa(cal) == ICAL_VEVENT_COMPONENT) {
- organizer = icalcomponent_get_first_property(cal,
- ICAL_ORGANIZER_PROPERTY);
+ organizer = icalcomponent_get_first_property(cal, ICAL_ORGANIZER_PROPERTY);
if (organizer != NULL) {
if (icalproperty_get_organizer(organizer)) {
strcpy(organizer_string,
/*
* Register this module with the Citadel server.
*/
-char *serv_calendar_init(void)
+CTDL_MODULE_INIT(calendar)
{
#ifdef CITADEL_WITH_CALENDAR_SERVICE
CtdlRegisterMessageHook(ical_obj_beforesave, EVT_BEFORESAVE);
CtdlRegisterSessionHook(ical_session_shutdown, EVT_STOP);
CtdlRegisterFixedOutputHook("text/calendar", ical_fixed_output);
#endif
+
+ /* return our Subversion id for the Log */
return "$Id$";
}