CtdlGetSysConfig() and CtdlPutSysConfig() now have the ability to store large configu...
[citadel.git] / citadel / modules / calendar / serv_calendar.c
index 02153287fd3996f8d19310e84ab945846f6b7124..0a9090d171de519ed68b9bd281fabb20fcde7b38 100644 (file)
@@ -3,7 +3,7 @@
  * room on a Citadel server.  It handles iCalendar objects using the
  * iTIP protocol.  See RFCs 2445 and 2446.
  *
- * Copyright (c) 1987-2018 by the citadel.org team
+ * Copyright (c) 1987-2021 by the citadel.org team
  *
  * This program is open source software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 3.
@@ -120,7 +120,6 @@ void ical_write_to_cal(struct ctdluser *u, icalcomponent *cal) {
                        serlen + 1,             /* length */
                        u,                      /* which user */
                        0,                      /* not binary */
-                       0,                      /* don't delete others of this type */
                        0                       /* no flags */
                );
        }
@@ -137,7 +136,6 @@ void ical_write_to_cal(struct ctdluser *u, icalcomponent *cal) {
                msg->cm_format_type = 4;
                CM_SetField(msg, eAuthor, CCC->user.fullname, strlen(CCC->user.fullname));
                CM_SetField(msg, eOriginalRoom, CCC->room.QRname, strlen(CCC->room.QRname));
-               CM_SetField(msg, eHumanNode, CtdlGetConfigStr("c_humannode"), strlen(CtdlGetConfigStr("c_humannode")));
 
                MsgBody = NewStrBufPlain(NULL, serlen + 100);
                StrBufAppendBufPlain(MsgBody, HKEY("Content-type: text/calendar\r\n\r\n"), 0);
@@ -146,7 +144,7 @@ void ical_write_to_cal(struct ctdluser *u, icalcomponent *cal) {
                CM_SetAsFieldSB(msg, eMesageText, &MsgBody);
        
                /* Now write the data */
-               CtdlSubmitMsg(msg, NULL, "", QP_EADDR);
+               CtdlSubmitMsg(msg, NULL, "");
                CM_Free(msg);
        }
 
@@ -172,13 +170,13 @@ void ical_send_a_reply(icalcomponent *request, char *action) {
        icalproperty *summary = NULL;
        char summary_string[SIZ];
        icalproperty *me_attend = NULL;
-       recptypes *recp = NULL;
+       struct recptypes *recp = NULL;
        icalparameter *partstat = NULL;
        char *serialized_reply = NULL;
        char *reply_message_text = NULL;
        const char *ch;
        struct CtdlMessage *msg = NULL;
-       recptypes *valid = NULL;
+       struct recptypes *valid = NULL;
 
        *organizer_string = '\0';
        strcpy(summary_string, "Calendar item");
@@ -298,7 +296,7 @@ void ical_send_a_reply(icalcomponent *request, char *action) {
        
                if (msg != NULL) {
                        valid = validate_recipients(organizer_string, NULL, 0);
-                       CtdlSubmitMsg(msg, valid, "", QP_EADDR);
+                       CtdlSubmitMsg(msg, valid, "");
                        CM_Free(msg);
                        free_recipients(valid);
                }
@@ -361,7 +359,7 @@ void ical_respond(long msgnum, char *partnum, char *action) {
                return;
        }
 
-       msg = CtdlFetchMessage(msgnum, 1, 1);
+       msg = CtdlFetchMessage(msgnum, 1);
        if (msg == NULL) {
                cprintf("%d Message %ld not found.\n",
                        ERROR + ILLEGAL_VALUE,
@@ -620,7 +618,7 @@ int ical_update_my_calendar_with_reply(icalcomponent *cal) {
         * us the ability to load the event into memory so we can diddle the
         * attendees.
         */
-       msg = CtdlFetchMessage(msgnum_being_replaced, 1, 1);
+       msg = CtdlFetchMessage(msgnum_being_replaced, 1);
        if (msg == NULL) {
                return(2);                      /* internal error */
        }
@@ -670,7 +668,7 @@ int ical_update_my_calendar_with_reply(icalcomponent *cal) {
        
                if (msg != NULL) {
                        CIT_ICAL->avoid_sending_invitations = 1;
-                       CtdlSubmitMsg(msg, NULL, roomname, QP_EADDR);
+                       CtdlSubmitMsg(msg, NULL, roomname);
                        CM_Free(msg);
                        CIT_ICAL->avoid_sending_invitations = 0;
                }
@@ -700,7 +698,7 @@ void ical_handle_rsvp(long msgnum, char *partnum, char *action) {
                return;
        }
 
-       msg = CtdlFetchMessage(msgnum, 1, 1);
+       msg = CtdlFetchMessage(msgnum, 1);
        if (msg == NULL) {
                cprintf("%d Message %ld not found.\n",
                        ERROR + ILLEGAL_VALUE,
@@ -1135,7 +1133,7 @@ void ical_hunt_for_conflicts_backend(long msgnum, void *data) {
 
        proposed_event = (icalcomponent *)data;
 
-       msg = CtdlFetchMessage(msgnum, 1, 1);
+       msg = CtdlFetchMessage(msgnum, 1);
        if (msg == NULL) return;
        memset(&ird, 0, sizeof ird);
        strcpy(ird.desired_partnum, "_HUNT_");
@@ -1194,7 +1192,7 @@ void ical_conflicts(long msgnum, char *partnum) {
        struct CtdlMessage *msg = NULL;
        struct ical_respond_data ird;
 
-       msg = CtdlFetchMessage(msgnum, 1, 1);
+       msg = CtdlFetchMessage(msgnum, 1);
        if (msg == NULL) {
                cprintf("%d Message %ld not found\n",
                        ERROR + ILLEGAL_VALUE,
@@ -1378,7 +1376,7 @@ void ical_freebusy_backend(long msgnum, void *data) {
 
        fb = (icalcomponent *)data;             /* User-supplied data will be the VFREEBUSY component */
 
-       msg = CtdlFetchMessage(msgnum, 1, 1);
+       msg = CtdlFetchMessage(msgnum, 1);
        if (msg == NULL) return;
        memset(&ird, 0, sizeof ird);
        strcpy(ird.desired_partnum, "_HUNT_");
@@ -1408,7 +1406,7 @@ void ical_freebusy(char *who) {
        icalcomponent *encaps = NULL;
        icalcomponent *fb = NULL;
        int found_user = (-1);
-       recptypes *recp = NULL;
+       struct recptypes *recp = NULL;
        char buf[256];
        char host[256];
        char type[256];
@@ -1575,7 +1573,7 @@ void ical_getics_backend(long msgnum, void *data) {
 
        /* Look for the calendar event... */
 
-       msg = CtdlFetchMessage(msgnum, 1, 1);
+       msg = CtdlFetchMessage(msgnum, 1);
        if (msg == NULL) return;
        memset(&ird, 0, sizeof ird);
        strcpy(ird.desired_partnum, "_HUNT_");
@@ -1961,7 +1959,7 @@ void ical_send_out_invitations(icalcomponent *top_level_cal, icalcomponent *cal)
        icalcomponent *encaps = NULL;
        char *request_message_text = NULL;
        struct CtdlMessage *msg = NULL;
-       recptypes *valid = NULL;
+       struct recptypes *valid = NULL;
        char attendees_string[SIZ];
        int num_attendees = 0;
        char this_attendee[256];
@@ -2170,7 +2168,7 @@ void ical_send_out_invitations(icalcomponent *top_level_cal, icalcomponent *cal)
        
                if (msg != NULL) {
                        valid = validate_recipients(attendees_string, NULL, 0);
-                       CtdlSubmitMsg(msg, valid, "", QP_EADDR);
+                       CtdlSubmitMsg(msg, valid, "");
                        CM_Free(msg);
                        free_recipients(valid);
                }
@@ -2350,7 +2348,7 @@ void ical_obj_beforesave_backend(char *name, char *filename, char *partnum,
  * If the message is being saved, we also set various message header fields
  * using data found in the iCalendar object.
  */
-int ical_obj_beforesave(struct CtdlMessage *msg, recptypes *recp)
+int ical_obj_beforesave(struct CtdlMessage *msg, struct recptypes *recp)
 {
        /* First determine if this is a calendar or tasks room */
        if (  (CC->room.QRdefaultview != VIEW_CALENDAR)
@@ -2417,7 +2415,7 @@ void ical_obj_aftersave_backend(char *name, char *filename, char *partnum,
  * (This will start back end tasks such as automatic generation of invitations,
  * if such actions are appropriate.)
  */
-int ical_obj_aftersave(struct CtdlMessage *msg, recptypes *recp)
+int ical_obj_aftersave(struct CtdlMessage *msg, struct recptypes *recp)
 {
        char roomname[ROOMNAMELEN];
 
@@ -2533,11 +2531,6 @@ void ical_fixed_output(char *ptr, int len) {
 }
 
 
-void serv_calendar_destroy(void) {
-       icaltimezone_free_builtin_timezones();
-}
-
-
 /*
  * Register this module with the Citadel server.
  */
@@ -2566,7 +2559,6 @@ CTDL_MODULE_INIT(calendar)
                CtdlRegisterSessionHook(ical_session_shutdown, EVT_STOP, PRIO_STOP + 80);
                CtdlRegisterFixedOutputHook("text/calendar", ical_fixed_output);
                CtdlRegisterFixedOutputHook("application/ics", ical_fixed_output);
-               CtdlRegisterCleanupHook(serv_calendar_destroy);
        }
 
        /* return our module name for the log */