]> code.citadel.org Git - citadel.git/blobdiff - citadel/serv_calendar.c
mk_module_init.sh now tests to see if echo supports -e and -E
[citadel.git] / citadel / serv_calendar.c
index aa859d025abdd8b09fe31362196f7f14f0a57e75..de35044412af7d29c44c283cb159b2e309bc9464 100644 (file)
 #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;
@@ -240,7 +241,7 @@ void ical_send_a_reply(icalcomponent *request, char *action) {
                                                        if (me_attend) icalproperty_free(me_attend);
                                                        me_attend = icalproperty_new_clone(attendee);
                                                }
-                                               free(recp);
+                                               free_recipients(recp);
                                        }
                                }
                        }
@@ -314,6 +315,7 @@ void ical_send_a_reply(icalcomponent *request, char *action) {
                        "",                     /* cc */
                        CC->room.QRname, 0, FMT_RFC822,
                        "",
+                       "",
                        summary_string,         /* Use summary for subject */
                        NULL,
                        reply_message_text);
@@ -322,6 +324,7 @@ void ical_send_a_reply(icalcomponent *request, char *action) {
                        valid = validate_recipients(organizer_string);
                        CtdlSubmitMsg(msg, valid, "");
                        CtdlFreeMessage(msg);
+                       free_recipients(valid);
                }
        }
        free(serialized_reply);
@@ -423,9 +426,9 @@ void ical_respond(long msgnum, char *partnum, char *action) {
                }
 
                /* 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);
@@ -685,6 +688,7 @@ int ical_update_my_calendar_with_reply(icalcomponent *cal) {
                        roomname,
                        0, FMT_RFC822,
                        "",
+                       "",
                        "",             /* no subject */
                        NULL,
                        message_text);
@@ -770,9 +774,9 @@ void ical_handle_rsvp(long msgnum, char *partnum, char *action) {
                }
 
                /* 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);
@@ -1187,7 +1191,7 @@ void ical_freebusy(char *who) {
                        if (recp->num_local == 1) {
                                found_user = getuser(&usbuf, recp->recp_local);
                        }
-                       free(recp);
+                       free_recipients(recp);
                }
        }
 
@@ -1202,7 +1206,7 @@ void ical_freebusy(char *who) {
                        if (recp->num_local == 1) {
                                found_user = getuser(&usbuf, recp->recp_local);
                        }
-                       free(recp);
+                       free_recipients(recp);
                }
        }
 
@@ -1225,7 +1229,7 @@ void ical_freebusy(char *who) {
                                        if (recp->num_local == 1) {
                                                found_user = getuser(&usbuf, recp->recp_local);
                                        }
-                                       free(recp);
+                                       free_recipients(recp);
                                }
                        }
                }
@@ -1411,7 +1415,7 @@ void ical_getics(void)
        /* 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. */
@@ -1756,6 +1760,7 @@ void ical_send_out_invitations(icalcomponent *cal) {
                        "",                     /* No single recipient here */
                        CC->room.QRname, 0, FMT_RFC822,
                        "",
+                       "",
                        summary_string,         /* Use summary for subject */
                        NULL,
                        request_message_text);
@@ -1764,7 +1769,7 @@ void ical_send_out_invitations(icalcomponent *cal) {
                        valid = validate_recipients(attendees_string);
                        CtdlSubmitMsg(msg, valid, "");
                        CtdlFreeMessage(msg);
-                       free (valid);
+                       free_recipients(valid);
                }
        }
        free(serialized_request);
@@ -1800,8 +1805,7 @@ void ical_saving_vevent(icalcomponent *cal) {
         * 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,
@@ -2133,7 +2137,7 @@ void ical_fixed_output(char *ptr, int len) {
 /*
  * 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);
@@ -2144,6 +2148,8 @@ char *serv_calendar_init(void)
        CtdlRegisterSessionHook(ical_session_shutdown, EVT_STOP);
        CtdlRegisterFixedOutputHook("text/calendar", ical_fixed_output);
 #endif
+
+       /* return our Subversion id for the Log */
        return "$Id$";
 }