serv_calendar.c: basically reformatting for modern standards
[citadel.git] / citadel / server / modules / calendar / serv_calendar.c
index 6820458983beef9de00b0e3e6f400a6cceb41b81..643212968f3976a3d02e5296eafbd39e87edaecc 100644 (file)
@@ -1,18 +1,11 @@
-/* 
- * This module implements iCalendar object processing and the Calendar>
- * room on a Citadel server.  It handles iCalendar objects using the
- * iTIP protocol.  See RFCs 2445 and 2446.
- *
- * Copyright (c) 1987-2022 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.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- */
+// This module implements iCalendar object processing and the Calendar>
+// room on a Citadel server.  It handles iCalendar objects using the
+// iTIP protocol.  See RFCs 2445 and 2446.
+//
+// Copyright (c) 1987-2024 by the citadel.org team
+//
+// This program is open source software.  Use, duplication, or disclosure
+// are subject to the terms of the GNU General Public License version 3.
 
 #define PRODID "-//Citadel//NONSGML Citadel Calendar//EN"
 
@@ -32,10 +25,8 @@ struct ical_respond_data {
 };
 
 
-/*
- * Utility function to create a new VCALENDAR component with some of the
- * required fields already set the way we like them.
- */
+// Utility function to create a new VCALENDAR component with some of the
+// required fields already set the way we like them.
 icalcomponent *icalcomponent_new_citadel_vcalendar(void) {
        icalcomponent *encaps;
 
@@ -45,46 +36,40 @@ icalcomponent *icalcomponent_new_citadel_vcalendar(void) {
                return NULL;
        }
 
-       /* Set the Product ID */
+       // Set the Product ID
        icalcomponent_add_property(encaps, icalproperty_new_prodid(PRODID));
 
-       /* Set the Version Number */
+       // Set the Version Number
        icalcomponent_add_property(encaps, icalproperty_new_version("2.0"));
 
        return(encaps);
 }
 
 
-/*
- * Utility function to encapsulate a subcomponent into a full VCALENDAR
- */
+// Utility function to encapsulate a subcomponent into a full VCALENDAR
 icalcomponent *ical_encapsulate_subcomponent(icalcomponent *subcomp) {
        icalcomponent *encaps;
 
-       /* If we're already looking at a full VCALENDAR component,
-        * don't bother ... just return itself.
-        */
+       // If we're already looking at a full VCALENDAR component, don't bother ... just return itself.
        if (icalcomponent_isa(subcomp) == ICAL_VCALENDAR_COMPONENT) {
                return subcomp;
        }
 
-       /* Encapsulate the VEVENT component into a complete VCALENDAR */
+       // Encapsulate the VEVENT component into a complete VCALENDAR
        encaps = icalcomponent_new_citadel_vcalendar();
        if (encaps == NULL) return NULL;
 
-       /* Encapsulate the subcomponent inside */
+       // Encapsulate the subcomponent inside
        icalcomponent_add_component(encaps, subcomp);
 
-       /* Return the object we just created. */
+       // Return the object we just created.
        return(encaps);
 }
 
 
-/*
- * Write a calendar object into the specified user's calendar room.
- * If the supplied user is NULL, this function writes the calendar object
- * to the currently selected room.
- */
+// Write a calendar object into the specified user's calendar room.
+// If the supplied user is NULL, this function writes the calendar object
+// to the currently selected room.
 void ical_write_to_cal(struct ctdluser *u, icalcomponent *cal) {
        char *ser = NULL;
        long serlen;
@@ -94,9 +79,8 @@ void ical_write_to_cal(struct ctdluser *u, icalcomponent *cal) {
 
        if (cal == NULL) return;
 
-       /* If the supplied object is a subcomponent, encapsulate it in
-        * a full VCALENDAR component, and save that instead.
-        */
+       // If the supplied object is a subcomponent, encapsulate it in
+       // a full VCALENDAR component, and save that instead.
        if (icalcomponent_isa(cal) != ICAL_VCALENDAR_COMPONENT) {
                tmp = icalcomponent_new_clone(cal);
                encaps = ical_encapsulate_subcomponent(tmp);
@@ -111,20 +95,20 @@ void ical_write_to_cal(struct ctdluser *u, icalcomponent *cal) {
 
        serlen = strlen(ser);
 
-       /* If the caller supplied a user, write to that user's default calendar room */
+       // If the caller supplied a user, write to that user's default calendar room
        if (u) {
-               /* This handy API function does all the work for us. */
-               CtdlWriteObject(USERCALENDARROOM,       /* which room */
-                       "text/calendar",        /* MIME type */
-                       ser,                    /* data */
-                       serlen + 1,             /* length */
-                       u,                      /* which user */
-                       0,                      /* not binary */
-                       0                       /* no flags */
+               CtdlWriteObject(                // This handy API function does all the work for us.
+                       USERCALENDARROOM,       // which room
+                       "text/calendar",        // MIME type
+                       ser,                    // data
+                       serlen + 1,             // length
+                       u,                      // which user
+                       0,                      // not binary
+                       0                       // no flags
                );
        }
 
-       /* If the caller did not supply a user, write to the currently selected room */
+       // If the caller did not supply a user, write to the currently selected room
        if (!u) {
                struct CitContext *CCC = CC;
                StrBuf *MsgBody;
@@ -134,8 +118,8 @@ void ical_write_to_cal(struct ctdluser *u, icalcomponent *cal) {
                msg->cm_magic = CTDLMESSAGE_MAGIC;
                msg->cm_anon_type = MES_NORMAL;
                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, eAuthor, CCC->user.fullname);
+               CM_SetField(msg, eOriginalRoom, CCC->room.QRname);
 
                MsgBody = NewStrBufPlain(NULL, serlen + 100);
                StrBufAppendBufPlain(MsgBody, HKEY("Content-type: text/calendar\r\n\r\n"), 0);
@@ -143,23 +127,20 @@ void ical_write_to_cal(struct ctdluser *u, icalcomponent *cal) {
 
                CM_SetAsFieldSB(msg, eMesageText, &MsgBody);
        
-               /* Now write the data */
+               // Now write the data
                CtdlSubmitMsg(msg, NULL, "");
                CM_Free(msg);
        }
 
-       /* In either case, now we can free the serialized calendar object */
+       // In either case, now we can free the serialized calendar object
        free(ser);
 }
 
 
-/*
- * Send a reply to a meeting invitation.
- *
- * 'request' is the invitation to reply to.
- * 'action' is the string "accept" or "decline" or "tentative".
- *
- */
+// Send a reply to a meeting invitation.
+//
+// 'request' is the invitation to reply to.
+// 'action' is the string "accept" or "decline" or "tentative".
 void ical_send_a_reply(icalcomponent *request, char *action) {
        icalcomponent *the_reply = NULL;
        icalcomponent *vevent = NULL;
@@ -192,22 +173,19 @@ void ical_send_a_reply(icalcomponent *request, char *action) {
                return;
        }
 
-       /* Change the method from REQUEST to REPLY */
+       // Change the method from REQUEST to REPLY
        icalcomponent_set_method(the_reply, ICAL_METHOD_REPLY);
 
        vevent = icalcomponent_get_first_component(the_reply, ICAL_VEVENT_COMPONENT);
        if (vevent != NULL) {
-               /* Hunt for attendees, removing ones that aren't us.
-                * (Actually, remove them all, cloning our own one so we can
-                * re-insert it later)
-                */
-               while (attendee = icalcomponent_get_first_property(vevent,
-                   ICAL_ATTENDEE_PROPERTY), (attendee != NULL)
-               ) {
+               // Hunt for attendees, removing ones that aren't us.
+               // (Actually, remove them all, cloning our own one so we can
+               // re-insert it later)
+               while (attendee = icalcomponent_get_first_property(vevent, ICAL_ATTENDEE_PROPERTY), (attendee != NULL)) {
                        ch = icalproperty_get_attendee(attendee);
                        if ((ch != NULL) && !strncasecmp(ch, "MAILTO:", 7)) {
                                safestrncpy(attendee_string, ch + 7, sizeof (attendee_string));
-                               striplt(attendee_string);
+                               string_trim(attendee_string);
                                recp = validate_recipients(attendee_string, NULL, 0);
                                if (recp != NULL) {
                                        if (!strcasecmp(recp->recp_local, CC->user.fullname)) {
@@ -218,14 +196,14 @@ void ical_send_a_reply(icalcomponent *request, char *action) {
                                }
                        }
 
-                       /* Remove it... */
+                       // Remove it...
                        icalcomponent_remove_property(vevent, attendee);
                        icalproperty_free(attendee);
                }
 
-               /* We found our own address in the attendee list. */
+               // We found our own address in the attendee list.
                if (me_attend) {
-                       /* Change the partstat from NEEDS-ACTION to ACCEPT or DECLINE */
+                       // Change the partstat from NEEDS-ACTION to ACCEPT or DECLINE
                        icalproperty_remove_parameter_by_kind(me_attend, ICAL_PARTSTAT_PARAMETER);
 
                        if (!strcasecmp(action, "accept")) {
@@ -240,11 +218,11 @@ void ical_send_a_reply(icalcomponent *request, char *action) {
 
                        if (partstat) icalproperty_add_parameter(me_attend, partstat);
 
-                       /* Now insert it back into the vevent. */
+                       // Now insert it back into the vevent.
                        icalcomponent_add_property(vevent, me_attend);
                }
 
-               /* Figure out who to send this thing to */
+               // Figure out who to send this thing to
                organizer = icalcomponent_get_first_property(vevent, ICAL_ORGANIZER_PROPERTY);
                if (organizer != NULL) {
                        if (icalproperty_get_organizer(organizer)) {
@@ -254,14 +232,13 @@ void ical_send_a_reply(icalcomponent *request, char *action) {
                }
                if (!strncasecmp(organizer_string, "MAILTO:", 7)) {
                        strcpy(organizer_string, &organizer_string[7]);
-                       striplt(organizer_string);
-               } else {
+                       string_trim(organizer_string);
+               }
+               else {
                        strcpy(organizer_string, "");
                }
 
-               /* Extract the summary string -- we'll use it as the
-                * message subject for the reply
-                */
+               // Extract the summary string -- we'll use it as the message subject for the reply
                summary = icalcomponent_get_first_property(vevent, ICAL_SUMMARY_PROPERTY);
                if (summary != NULL) {
                        if (icalproperty_get_summary(summary)) {
@@ -271,9 +248,9 @@ void ical_send_a_reply(icalcomponent *request, char *action) {
                }
        }
 
-       /* Now generate the reply message and send it out. */
+       // Now generate the reply message and send it out.
        serialized_reply = icalcomponent_as_ical_string_r(the_reply);
-       icalcomponent_free(the_reply);  /* don't need this anymore */
+       icalcomponent_free(the_reply);  // don't need this anymore
        if (serialized_reply == NULL) return;
 
        reply_message_text = malloc(strlen(serialized_reply) + SIZ);
@@ -284,15 +261,18 @@ void ical_send_a_reply(icalcomponent *request, char *action) {
                );
 
                msg = CtdlMakeMessage(&CC->user,
-                       organizer_string,       /* to */
-                       "",                     /* cc */
-                       CC->room.QRname, 0, FMT_RFC822,
+                       organizer_string,       // to
+                       "",                     // cc
+                       CC->room.QRname,
+                       0,
+                       FMT_RFC822,
                        "",
                        "",
-                       summary_string,         /* Use summary for subject */
+                       summary_string,         // Use the event SUMMARY as the message subject
                        NULL,
                        reply_message_text,
-                       NULL);
+                       NULL
+               );
        
                if (msg != NULL) {
                        valid = validate_recipients(organizer_string, NULL, 0);
@@ -305,11 +285,9 @@ void ical_send_a_reply(icalcomponent *request, char *action) {
 }
 
 
-/*
- * Callback function for mime parser that hunts for calendar content types
- * and turns them into calendar objects.  If something is found, it is placed
- * in ird->cal, and the caller now owns that memory and is responsible for freeing it.
- */
+// Callback function for mime parser that hunts for calendar content types
+// and turns them into calendar objects.  If something is found, it is placed
+// in ird->cal, and the caller now owns that memory and is responsible for freeing it.
 void ical_locate_part(char *name, char *filename, char *partnum, char *disp,
                void *content, char *cbtype, char *cbcharset, size_t length, char *encoding,
                char *cbid, void *cbuserdata) {
@@ -318,18 +296,18 @@ void ical_locate_part(char *name, char *filename, char *partnum, char *disp,
 
        ird = (struct ical_respond_data *) cbuserdata;
 
-       /* desired_partnum can be set to "_HUNT_" to have it just look for
-        * the first part with a content type of text/calendar.  Otherwise
-        * we have to only process the right one.
-        */
+       // desired_partnum can be set to "_HUNT_" to have it just look for
+       // the first part with a content type of text/calendar.  Otherwise
+       // we have to only process the right one.
        if (strcasecmp(ird->desired_partnum, "_HUNT_")) {
                if (strcasecmp(partnum, ird->desired_partnum)) {
                        return;
                }
        }
 
-       if (  (strcasecmp(cbtype, "text/calendar"))
-          && (strcasecmp(cbtype, "application/ics")) ) {
+       if (    (strcasecmp(cbtype, "text/calendar"))
+               && (strcasecmp(cbtype, "application/ics"))
+       ) {
                return;
        }
 
@@ -342,66 +320,55 @@ void ical_locate_part(char *name, char *filename, char *partnum, char *disp,
 }
 
 
-/*
- * Respond to a meeting request.
- */
+// Respond to a meeting request.
 void ical_respond(long msgnum, char *partnum, char *action) {
        struct CtdlMessage *msg = NULL;
        struct ical_respond_data ird;
 
        if (
-          (strcasecmp(action, "accept"))
-          && (strcasecmp(action, "decline"))
+               (strcasecmp(action, "accept"))
+               && (strcasecmp(action, "decline"))
        ) {
-               cprintf("%d Action must be 'accept' or 'decline'\n",
-                       ERROR + ILLEGAL_VALUE
-               );
+               cprintf("%d Action must be 'accept' or 'decline'\n", ERROR + ILLEGAL_VALUE);
                return;
        }
 
        msg = CtdlFetchMessage(msgnum, 1);
        if (msg == NULL) {
-               cprintf("%d Message %ld not found.\n",
-                       ERROR + ILLEGAL_VALUE,
-                       (long)msgnum
-               );
+               cprintf("%d Message %ld not found.\n", ERROR + ILLEGAL_VALUE, (long)msgnum);
                return;
        }
 
        memset(&ird, 0, sizeof ird);
        strcpy(ird.desired_partnum, partnum);
        mime_parser(CM_RANGE(msg, eMesageText),
-                   *ical_locate_part,          /* callback function */
-                   NULL, NULL,
-                   (void *) &ird,                      /* user data */
-                   0
+               *ical_locate_part,              // callback function
+               NULL,
+               NULL,
+               (void *) &ird,                  // user data
+               0
        );
 
-       /* We're done with the incoming message, because we now have a
-        * calendar object in memory.
-        */
+       // We're done with the incoming message, because we now have a * calendar object in memory.
        CM_Free(msg);
 
-       /*
-        * Here is the real meat of this function.  Handle the event.
-        */
+       // Here is the real meat of this function.  Handle the event.
        if (ird.cal != NULL) {
-               /* Save this in the user's calendar if necessary */
+               // Save this in the user's calendar if necessary
                if (!strcasecmp(action, "accept")) {
                        ical_write_to_cal(&CC->user, ird.cal);
                }
 
-               /* Send a reply if necessary */
+               // Send a reply if necessary
                if (icalcomponent_get_method(ird.cal) == ICAL_METHOD_REQUEST) {
                        ical_send_a_reply(ird.cal, action);
                }
 
-               /* 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, "");
-                */
+               // 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. */
+               // Free the memory we allocated and return a response.
                icalcomponent_free(ird.cal);
                ird.cal = NULL;
                cprintf("%d ok\n", CIT_OK);
@@ -412,19 +379,17 @@ void ical_respond(long msgnum, char *partnum, char *action) {
                return;
        }
 
-       /* should never get here */
+       // should never get here
 }
 
 
-/*
- * Figure out the UID of the calendar event being referred to in a
- * REPLY object.  This function is recursive.
- */
+// Figure out the UID of the calendar event being referred to in a
+// REPLY object.  This function is recursive.
 void ical_learn_uid_of_reply(char *uidbuf, icalcomponent *cal) {
        icalcomponent *subcomponent;
        icalproperty *p;
 
-       /* If this object is a REPLY, then extract the UID. */
+       // If this object is a REPLY, then extract the UID.
        if (icalcomponent_isa(cal) == ICAL_VEVENT_COMPONENT) {
                p = icalcomponent_get_first_property(cal, ICAL_UID_PROPERTY);
                if (p != NULL) {
@@ -432,22 +397,20 @@ void ical_learn_uid_of_reply(char *uidbuf, icalcomponent *cal) {
                }
        }
 
-       /* Otherwise, recurse through any VEVENT subcomponents.  We do NOT want the
-        * UID of the reply; we want the UID of the invitation being replied to.
-        */
+       // Otherwise, recurse through any VEVENT subcomponents.  We do NOT want the
+       // UID of the reply; we want the UID of the invitation being replied to.
        for (subcomponent = icalcomponent_get_first_component(cal, ICAL_VEVENT_COMPONENT);
-           subcomponent != NULL;
-           subcomponent = icalcomponent_get_next_component(cal, ICAL_VEVENT_COMPONENT) ) {
+               subcomponent != NULL;
+               subcomponent = icalcomponent_get_next_component(cal, ICAL_VEVENT_COMPONENT)
+       ) {
                ical_learn_uid_of_reply(uidbuf, subcomponent);
        }
 }
 
 
-/*
- * ical_update_my_calendar_with_reply() refers to this callback function; when we
- * locate the message containing the calendar event we're replying to, this function
- * gets called.  It basically just sticks the message number in a supplied buffer.
- */
+// ical_update_my_calendar_with_reply() refers to this callback function; when we
+// locate the message containing the calendar event we're replying to, this function
+// gets called.  It basically just sticks the message number in a supplied buffer.
 void ical_hunt_for_event_to_update(long msgnum, void *data) {
        long *msgnumptr;
 
@@ -460,19 +423,18 @@ struct original_event_container {
        icalcomponent *c;
 };
 
-/*
- * Callback function for mime parser that hunts for calendar content types
- * and turns them into calendar objects (called by ical_update_my_calendar_with_reply()
- * to fetch the object being updated)
- */
+// Callback function for mime parser that hunts for calendar content types
+// and turns them into calendar objects (called by ical_update_my_calendar_with_reply()
+// to fetch the object being updated)
 void ical_locate_original_event(char *name, char *filename, char *partnum, char *disp,
                void *content, char *cbtype, char *cbcharset, size_t length, char *encoding,
                char *cbid, void *cbuserdata) {
 
        struct original_event_container *oec = NULL;
 
-       if (  (strcasecmp(cbtype, "text/calendar"))
-          && (strcasecmp(cbtype, "application/ics")) ) {
+       if (    (strcasecmp(cbtype, "text/calendar"))
+               && (strcasecmp(cbtype, "application/ics"))
+       ) {
                return;
        }
        oec = (struct original_event_container *) cbuserdata;
@@ -483,16 +445,13 @@ void ical_locate_original_event(char *name, char *filename, char *partnum, char
 }
 
 
-/*
- * Merge updated attendee information from a REPLY into an existing event.
- */
+// Merge updated attendee information from a REPLY into an existing event.
 void ical_merge_attendee_reply(icalcomponent *event, icalcomponent *reply) {
        icalcomponent *c;
        icalproperty *e_attendee, *r_attendee;
 
-       /* First things first.  If we're not looking at a VEVENT component,
-        * recurse through subcomponents until we find one.
-        */
+       // First things first.  If we're not looking at a VEVENT component,
+       // recurse through subcomponents until we find one.
        if (icalcomponent_isa(event) != ICAL_VEVENT_COMPONENT) {
                for (c = icalcomponent_get_first_component(event, ICAL_VEVENT_COMPONENT);
                    c != NULL;
@@ -502,8 +461,7 @@ void ical_merge_attendee_reply(icalcomponent *event, icalcomponent *reply) {
                return;
        }
 
-       /* Now do the same thing with the reply.
-        */
+       // Now do the same thing with the reply.
        if (icalcomponent_isa(reply) != ICAL_VEVENT_COMPONENT) {
                for (c = icalcomponent_get_first_component(reply, ICAL_VEVENT_COMPONENT);
                    c != NULL;
@@ -513,12 +471,11 @@ void ical_merge_attendee_reply(icalcomponent *event, icalcomponent *reply) {
                return;
        }
 
-       /* Clone the reply, because we're going to rip its guts out. */
+       // Clone the reply, because we're going to rip its guts out.
        reply = icalcomponent_new_clone(reply);
 
-       /* At this point we're looking at the correct subcomponents.
-        * Iterate through the attendees looking for a match.
-        */
+       // At this point we're looking at the correct subcomponents.
+       // Iterate through the attendees looking for a match.
 STARTOVER:
        for (e_attendee = icalcomponent_get_first_property(event, ICAL_ATTENDEE_PROPERTY);
            e_attendee != NULL;
@@ -528,8 +485,7 @@ STARTOVER:
                    r_attendee != NULL;
                    r_attendee = icalcomponent_get_next_property(reply, ICAL_ATTENDEE_PROPERTY)) {
 
-                       /* Check to see if these two attendees match...
-                        */
+                       // Check to see if these two attendees match...
                        const char *e, *r;
                        e = icalproperty_get_attendee(e_attendee);
                        r = icalproperty_get_attendee(r_attendee);
@@ -537,42 +493,38 @@ STARTOVER:
                        if ((e != NULL) && 
                            (r != NULL) && 
                            !strcasecmp(e, r)) {
-                               /* ...and if they do, remove the attendee from the event
-                                * and replace it with the attendee from the reply.  (The
-                                * reply's copy will have the same address, but an updated
-                                * status.)
-                                */
+                               // ...and if they do, remove the attendee from the event
+                               // and replace it with the attendee from the reply.  (The
+                               // reply's copy will have the same address, but an updated
+                               // status.)
                                icalcomponent_remove_property(event, e_attendee);
                                icalproperty_free(e_attendee);
                                icalcomponent_remove_property(reply, r_attendee);
                                icalcomponent_add_property(event, r_attendee);
 
-                               /* Since we diddled both sets of attendees, we have to start
-                                * the iteration over again.  This will not create an infinite
-                                * loop because we removed the attendee from the reply.  (That's
-                                * why we cloned the reply, and that's what we mean by "ripping
-                                * its guts out.")
-                                */
+                               // Since we diddled both sets of attendees, we have to start
+                               // the iteration over again.  This will not create an infinite
+                               // loop because we removed the attendee from the reply.  (That's
+                               // why we cloned the reply, and that's what we mean by "ripping
+                               // its guts out.")
                                goto STARTOVER;
                        }
        
                }
        }
 
-       /* Free the *clone* of the reply. */
+       // Free the *clone* of the reply.
        icalcomponent_free(reply);
 }
 
 
-/*
- * Handle an incoming RSVP (object with method==ICAL_METHOD_REPLY) for a
- * calendar event.  The object has already been deserialized for us; all
- * we have to do here is hunt for the event in our calendar, merge in the
- * updated attendee status, and save it again.
- *
- * This function returns 0 on success, 1 if the event was not found in the
- * user's calendar, or 2 if an internal error occurred.
- */
+// Handle an incoming RSVP (object with method==ICAL_METHOD_REPLY) for a
+// calendar event.  The object has already been deserialized for us; all
+// we have to do here is hunt for the event in our calendar, merge in the
+// updated attendee status, and save it again.
+//
+// This function returns 0 on success, 1 if the event was not found in the
+// user's calendar, or 2 if an internal error occurred.
 int ical_update_my_calendar_with_reply(icalcomponent *cal) {
        char uid[SIZ];
        char hold_rm[ROOMNAMELEN];
@@ -584,12 +536,12 @@ int ical_update_my_calendar_with_reply(icalcomponent *cal) {
        char roomname[ROOMNAMELEN];
        char *message_text = NULL;
 
-       /* Figure out just what event it is we're dealing with */
+       // Figure out just what event it is we're dealing with
        strcpy(uid, "--==<< InVaLiD uId >>==--");
        ical_learn_uid_of_reply(uid, cal);
        syslog(LOG_DEBUG, "calendar: UID of event being replied to is <%s>", uid);
 
-       strcpy(hold_rm, CC->room.QRname);       /* save current room */
+       strcpy(hold_rm, CC->room.QRname);       // save current room
 
        if (CtdlGetRoom(&CC->room, USERCALENDARROOM) != 0) {
                CtdlGetRoom(&CC->room, hold_rm);
@@ -597,37 +549,34 @@ int ical_update_my_calendar_with_reply(icalcomponent *cal) {
                return(2);
        }
 
-       /*
-        * Look in the EUID index for a message with
-        * the Citadel EUID set to the value we're looking for.  Since
-        * Citadel always sets the message EUID to the iCalendar UID of
-        * the event, this will work.
-        */
+       // Look in the EUID index for a message with
+       // the Citadel EUID set to the value we're looking for.  Since
+       // Citadel always sets the message EUID to the iCalendar UID of
+       // the event, this will work.
        msgnum_being_replaced = CtdlLocateMessageByEuid(uid, &CC->room);
 
-       CtdlGetRoom(&CC->room, hold_rm);        /* return to saved room */
+       CtdlGetRoom(&CC->room, hold_rm);        // return to saved room
 
        syslog(LOG_DEBUG, "calendar: msgnum_being_replaced == %ld", msgnum_being_replaced);
        if (msgnum_being_replaced == 0) {
-               return(1);                      /* no calendar event found */
+               return(1);                      // no calendar event found
        }
 
-       /* Now we know the ID of the message containing the event being updated.
-        * We don't actually have to delete it; that'll get taken care of by the
-        * server when we save another event with the same UID.  This just gives
-        * us the ability to load the event into memory so we can diddle the
-        * attendees.
-        */
+       // Now we know the ID of the message containing the event being updated.
+       // We don't actually have to delete it; that'll get taken care of by the
+       // server when we save another event with the same UID.  This just gives
+       // us the ability to load the event into memory so we can diddle the attendees.
        msg = CtdlFetchMessage(msgnum_being_replaced, 1);
        if (msg == NULL) {
-               return(2);                      /* internal error */
+               return(2);                      // internal error
        }
        oec.c = NULL;
-       mime_parser(CM_RANGE(msg, eMesageText),
-                   *ical_locate_original_event,        /* callback function */
-                   NULL, NULL,
-                   &oec,                               /* user data */
-                   0
+       mime_parser(
+               CM_RANGE(msg, eMesageText),
+               *ical_locate_original_event,    // callback function
+               NULL, NULL,
+               &oec,                           // user data
+               0
        );
        CM_Free(msg);
 
@@ -637,12 +586,12 @@ int ical_update_my_calendar_with_reply(icalcomponent *cal) {
                return(2);
        }
 
-       /* Merge the attendee's updated status into the event */
+       // Merge the attendee's updated status into the event
        ical_merge_attendee_reply(original_event, cal);
 
-       /* Serialize it */
+       // Serialize it
        serialized_event = icalcomponent_as_ical_string_r(original_event);
-       icalcomponent_free(original_event);     /* Don't need this anymore. */
+       icalcomponent_free(original_event);     // Don't need this anymore.
        if (serialized_event == NULL) return(2);
 
        CtdlMailboxName(roomname, sizeof roomname, &CC->user, USERCALENDARROOM);
@@ -655,16 +604,18 @@ int ical_update_my_calendar_with_reply(icalcomponent *cal) {
                );
 
                msg = CtdlMakeMessage(&CC->user,
-                       "",                     /* No recipient */
-                       "",                     /* No recipient */
+                       "",                     // No recipient
+                       "",                     // No recipient
                        roomname,
-                       0, FMT_RFC822,
+                       0,
+                       FMT_RFC822,
                        "",
                        "",
-                       "",             /* no subject */
+                       "",                     // no subject
                        NULL,
                        message_text,
-                       NULL);
+                       NULL
+               );
        
                if (msg != NULL) {
                        CIT_ICAL->avoid_sending_invitations = 1;
@@ -678,23 +629,19 @@ int ical_update_my_calendar_with_reply(icalcomponent *cal) {
 }
 
 
-/*
- * Handle an incoming RSVP for an event.  (This is the server subcommand part; it
- * simply extracts the calendar object from the message, deserializes it, and
- * passes it up to ical_update_my_calendar_with_reply() for processing.
- */
+// Handle an incoming RSVP for an event.  (This is the server subcommand part; it
+// simply extracts the calendar object from the message, deserializes it, and
+// passes it up to ical_update_my_calendar_with_reply() for processing.
 void ical_handle_rsvp(long msgnum, char *partnum, char *action) {
        struct CtdlMessage *msg = NULL;
        struct ical_respond_data ird;
        int ret;
 
        if (
-          (strcasecmp(action, "update"))
-          && (strcasecmp(action, "ignore"))
+               (strcasecmp(action, "update"))
+               && (strcasecmp(action, "ignore"))
        ) {
-               cprintf("%d Action must be 'update' or 'ignore'\n",
-                       ERROR + ILLEGAL_VALUE
-               );
+               cprintf("%d Action must be 'update' or 'ignore'\n", ERROR + ILLEGAL_VALUE);
                return;
        }
 
@@ -709,48 +656,43 @@ void ical_handle_rsvp(long msgnum, char *partnum, char *action) {
 
        memset(&ird, 0, sizeof ird);
        strcpy(ird.desired_partnum, partnum);
-       mime_parser(CM_RANGE(msg, eMesageText),
-                   *ical_locate_part,          /* callback function */
-                   NULL, NULL,
-                   (void *) &ird,                      /* user data */
-                   0
-               );
+       mime_parser(
+               CM_RANGE(msg, eMesageText),
+               *ical_locate_part,                      // callback function
+               NULL,
+               NULL,
+               (void *) &ird,                          // user data
+               0
+       );
 
-       /* We're done with the incoming message, because we now have a
-        * calendar object in memory.
-        */
+       // We're done with the incoming message, because we now have a
+       // calendar object in memory.
        CM_Free(msg);
 
-       /*
-        * Here is the real meat of this function.  Handle the event.
-        */
+       // Here is the real meat of this function.  Handle the event.
        if (ird.cal != NULL) {
-               /* Update the user's calendar if necessary */
+               // Update the user's calendar if necessary
                if (!strcasecmp(action, "update")) {
                        ret = ical_update_my_calendar_with_reply(ird.cal);
                        if (ret == 0) {
-                               cprintf("%d Your calendar has been updated with this reply.\n",
-                                       CIT_OK);
+                               cprintf("%d Your calendar has been updated with this reply.\n", CIT_OK);
                        }
                        else if (ret == 1) {
-                               cprintf("%d This event does not exist in your calendar.\n",
-                                       ERROR + FILE_NOT_FOUND);
+                               cprintf("%d This event does not exist in your calendar.\n", ERROR + FILE_NOT_FOUND);
                        }
                        else {
-                               cprintf("%d An internal error occurred.\n",
-                                       ERROR + INTERNAL_ERROR);
+                               cprintf("%d An internal error occurred.\n", ERROR + INTERNAL_ERROR);
                        }
                }
                else {
                        cprintf("%d This reply has been ignored.\n", CIT_OK);
                }
 
-               /* Now that we've processed this message, we don't need it
-                * anymore.  So delete it.  (Don't do this anymore.)
-               CtdlDeleteMessages(CC->room.QRname, &msgnum, 1, "");
-                */
+               // Now that we've processed this message, we don't need it
+               // anymore.  So delete it.  (Don't do this anymore.)
+               // CtdlDeleteMessages(CC->room.QRname, &msgnum, 1, "");
 
-               /* Free the memory we allocated and return a response. */
+               // Free the memory we allocated and return a response.
                icalcomponent_free(ird.cal);
                ird.cal = NULL;
                return;
@@ -760,13 +702,11 @@ void ical_handle_rsvp(long msgnum, char *partnum, char *action) {
                return;
        }
 
-       /* should never get here */
+       // should never get here
 }
 
 
-/*
- * Search for a property in both the top level and in a VEVENT subcomponent
- */
+// Search for a property in both the top level and in a VEVENT subcomponent
 icalproperty *ical_ctdl_get_subprop(
                icalcomponent *cal,
                icalproperty_kind which_prop
@@ -776,8 +716,7 @@ icalproperty *ical_ctdl_get_subprop(
 
        p = icalcomponent_get_first_property(cal, which_prop);
        if (p == NULL) {
-               c = icalcomponent_get_first_component(cal,
-                                                       ICAL_VEVENT_COMPONENT);
+               c = icalcomponent_get_first_component(cal, ICAL_VEVENT_COMPONENT);
                if (c != NULL) {
                        p = icalcomponent_get_first_property(c, which_prop);
                }
@@ -786,11 +725,9 @@ icalproperty *ical_ctdl_get_subprop(
 }
 
 
-/*
- * Check to see if two events overlap.  Returns nonzero if they do.
- * (This function is used in both Citadel and WebCit.  If you change it in
- * one place, change it in the other.  Better yet, put it in a library.)
- */
+// Check to see if two events overlap.  Returns nonzero if they do.
+// (This function is used in both Citadel and WebCit.  If you change it in
+// one place, change it in the other.  Better yet, put it in a library.)
 int ical_ctdl_is_overlap(
                        struct icaltimetype t1start,
                        struct icaltimetype t1end,
@@ -800,19 +737,20 @@ int ical_ctdl_is_overlap(
        if (icaltime_is_null_time(t1start)) return(0);
        if (icaltime_is_null_time(t2start)) return(0);
 
-       /* if either event lacks end time, assume end = start */
-       if (icaltime_is_null_time(t1end))
+       // if either event lacks end time, assume end = start
+       if (icaltime_is_null_time(t1end)) {
                memcpy(&t1end, &t1start, sizeof(struct icaltimetype));
+       }
        else {
                if (t1end.is_date && icaltime_compare(t1start, t1end)) {
-                        /*
-                         * the end date is non-inclusive so adjust it by one
-                         * day because our test is inclusive, note that a day is
-                         * not too much because we are talking about all day
-                         * events
-                        * if start = end we assume that nevertheless the whole
-                        * day is meant
-                         */
+
+                       // the end date is non-inclusive so adjust it by one
+                       // day because our test is inclusive, note that a day is
+                       // not too much because we are talking about all day
+                       // events
+                       // if start = end we assume that nevertheless the whole
+                       // day is meant
+
                        icaltime_adjust(&t1end, -1, 0, 0, 0);   
                }
        }
@@ -876,17 +814,17 @@ int ical_conflicts_phase6(struct icaltimetype t1start,
 {
        int conflict_reported = 0;
 
-       /* debugging cruft *
-       time_t tt;
-       tt = icaltime_as_timet_with_zone(t1start, t1start.zone);
-       syslog(LOG_DEBUG, "PROPOSED START: %s", ctime(&tt));
-       tt = icaltime_as_timet_with_zone(t1end, t1end.zone);
-       syslog(LOG_DEBUG, "  PROPOSED END: %s", ctime(&tt));
-       tt = icaltime_as_timet_with_zone(t2start, t2start.zone);
-       syslog(LOG_DEBUG, "EXISTING START: %s", ctime(&tt));
-       tt = icaltime_as_timet_with_zone(t2end, t2end.zone);
-       syslog(LOG_DEBUG, "  EXISTING END: %s", ctime(&tt));
-       * debugging cruft */
+       //      debugging cruft
+       //      time_t tt;
+       //      tt = icaltime_as_timet_with_zone(t1start, t1start.zone);
+       //      syslog(LOG_DEBUG, "PROPOSED START: %s", ctime(&tt));
+       //      tt = icaltime_as_timet_with_zone(t1end, t1end.zone);
+       //      syslog(LOG_DEBUG, "  PROPOSED END: %s", ctime(&tt));
+       //      tt = icaltime_as_timet_with_zone(t2start, t2start.zone);
+       //      syslog(LOG_DEBUG, "EXISTING START: %s", ctime(&tt));
+       //      tt = icaltime_as_timet_with_zone(t2end, t2end.zone);
+       //      syslog(LOG_DEBUG, "  EXISTING END: %s", ctime(&tt));
+       //      debugging cruft
 
        /* compare and output */
 
@@ -907,13 +845,11 @@ int ical_conflicts_phase6(struct icaltimetype t1start,
 }
 
 
-/*
- * Phase 5 of "hunt for conflicts"
- * Called by ical_conflicts_phase4()
- *
- * We have the proposed event boiled down to start and end times.
- * Now check it against an existing event. 
- */
+// Phase 5 of "hunt for conflicts"
+// Called by ical_conflicts_phase4()
+//
+// We have the proposed event boiled down to start and end times.
+// Now check it against an existing event. 
 void ical_conflicts_phase5(struct icaltimetype t1start,
                        struct icaltimetype t1end,
                        icalcomponent *existing_event,
@@ -965,9 +901,7 @@ void ical_conflicts_phase5(struct icaltimetype t1start,
                }
                else {
                        t2end.zone = icalcomponent_get_timezone(existing_event,
-                               icalparameter_get_tzid(
-                                       icalproperty_get_first_parameter(p, ICAL_TZID_PARAMETER)
-                               )
+                               icalparameter_get_tzid(icalproperty_get_first_parameter(p, ICAL_TZID_PARAMETER))
                        );
                        if (!t2end.zone) {
                                t2end.zone = get_default_icaltimezone();
@@ -1138,10 +1072,11 @@ void ical_hunt_for_conflicts_backend(long msgnum, void *data) {
        memset(&ird, 0, sizeof ird);
        strcpy(ird.desired_partnum, "_HUNT_");
        mime_parser(CM_RANGE(msg, eMesageText),
-                   *ical_locate_part,          /* callback function */
-                   NULL, NULL,
-                   (void *) &ird,                      /* user data */
-                   0
+               *ical_locate_part,              // callback function
+               NULL,
+               NULL,
+               (void *) &ird,                  // user data
+               0
        );
        CM_Free(msg);
 
@@ -1630,19 +1565,17 @@ void ical_getics_backend(long msgnum, void *data) {
 }
 
 
-/*
- * Retrieve all of the calendar items in the current room, and output them
- * as a single icalendar object.
- */
-void ical_getics(void)
-{
+// Retrieve all of the calendar items in the current room, and output them
+// as a single icalendar object.
+void ical_getics(void) {
        icalcomponent *encaps = NULL;
        char *ser = NULL;
 
-       if ( (CC->room.QRdefaultview != VIEW_CALENDAR)
-          &&(CC->room.QRdefaultview != VIEW_TASKS) ) {
+       if (    (CC->room.QRdefaultview != VIEW_CALENDAR)
+               &&(CC->room.QRdefaultview != VIEW_TASKS)
+       ) {
                cprintf("%d Not a calendar room\n", ERROR+NOT_HERE);
-               return;         /* Not an iCalendar-centric room */
+               return;         /* This room does not contain a calendar. */
        }
 
        encaps = icalcomponent_new_vcalendar();
@@ -1679,13 +1612,10 @@ void ical_getics(void)
 }
 
 
-/*
- * Helper callback function for ical_putics() to discover which TZID's we need.
- * Simply put the tzid name string into a hash table.  After the callbacks are
- * done we'll go through them and attach the ones that we have.
- */
-void ical_putics_grabtzids(icalparameter *param, void *data)
-{
+// Helper callback function for ical_putics() to discover which TZID's we need.
+// Simply put the tzid name string into a hash table.  After the callbacks are
+// done we'll go through them and attach the ones that we have.
+void ical_putics_grabtzids(icalparameter *param, void *data) {
        const char *tzid = icalparameter_get_tzid(param);
        HashList *keys = (HashList *) data;
        
@@ -1695,12 +1625,9 @@ void ical_putics_grabtzids(icalparameter *param, void *data)
 }
 
 
-/*
- * Delete all of the calendar items in the current room, and replace them
- * with calendar items from a client-supplied data stream.
- */
-void ical_putics(void)
-{
+// Delete all of the calendar items in the current room, and replace them
+// with calendar items from a client-supplied data stream.
+void ical_putics(void) {
        char *calstream = NULL;
        icalcomponent *cal;
        icalcomponent *c;
@@ -1711,14 +1638,15 @@ void ical_putics(void)
        const char *Key;
        long len;
 
-       /* Only allow this operation if we're in a room containing a calendar or tasks view */
-       if ( (CC->room.QRdefaultview != VIEW_CALENDAR)
-          &&(CC->room.QRdefaultview != VIEW_TASKS) ) {
+       // Only allow this operation if we're in a room containing a calendar or tasks view
+       if (    (CC->room.QRdefaultview != VIEW_CALENDAR)
+               && (CC->room.QRdefaultview != VIEW_TASKS)
+       ) {
                cprintf("%d Not a calendar room\n", ERROR+NOT_HERE);
                return;
        }
 
-       /* Only allow this operation if we have permission to overwrite the existing calendar */
+       // Only allow this operation if we have permission to overwrite the existing calendar
        if (!CtdlDoIHavePermissionToDeleteMessagesFromThisRoom()) {
                cprintf("%d Permission denied.\n", ERROR+HIGHER_ACCESS_REQUIRED);
                return;
@@ -1753,8 +1681,9 @@ void ical_putics(void)
         */
        else {
                for (c = icalcomponent_get_first_component(cal, ICAL_ANY_COMPONENT);
-                   (c != NULL);
-                   c = icalcomponent_get_next_component(cal, ICAL_ANY_COMPONENT)) {
+                       (c != NULL);
+                       c = icalcomponent_get_next_component(cal, ICAL_ANY_COMPONENT)
+               ) {
 
                        /* Non-VTIMEZONE components each get written as individual messages.
                         * But we also need to attach the relevant VTIMEZONE components to them.
@@ -1814,8 +1743,7 @@ void ical_putics(void)
 /*
  * All Citadel calendar commands from the client come through here.
  */
-void cmd_ical(char *argbuf)
-{
+void cmd_ical(char *argbuf) {
        char subcmd[64];
        long msgnum;
        char partnum[256];
@@ -1885,10 +1813,9 @@ void cmd_ical(char *argbuf)
 /*
  * We don't know if the calendar room exists so we just create it at login
  */
-void ical_CtdlCreateRoom(void)
-{
+void ical_CtdlCreateRoom(void) {
        struct ctdlroom qr;
-       visit vbuf;
+       struct visit vbuf;
 
        /* Create the calendar room if it doesn't already exist */
        CtdlCreateRoom(USERCALENDARROOM, 4, "", 0, 1, 0, VIEW_CALENDAR);
@@ -2220,7 +2147,7 @@ void ical_saving_vevent(icalcomponent *top_level_cal, icalcomponent *cal) {
                }
                if (!strncasecmp(organizer_string, "MAILTO:", 7)) {
                        strcpy(organizer_string, &organizer_string[7]);
-                       striplt(organizer_string);
+                       string_trim(organizer_string);
                        /*
                         * If the user saving the event is listed as the
                         * organizer, then send out invitations.
@@ -2303,7 +2230,7 @@ void ical_obj_beforesave_backend(char *name, char *filename, char *partnum,
                        if (p != NULL) {
                                pch = icalproperty_get_comment(p);
                                if (!IsEmptyStr(pch)) {
-                                       CM_SetField(msg, eExclusiveID, pch, strlen(pch));
+                                       CM_SetField(msg, eExclusiveID, pch);
                                        syslog(LOG_DEBUG, "calendar: saving calendar UID <%s>", pch);
                                }
                        }
@@ -2348,8 +2275,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, struct 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)
           && (CC->room.QRdefaultview != VIEW_TASKS)
@@ -2415,8 +2341,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, struct recptypes *recp)
-{
+int ical_obj_aftersave(struct CtdlMessage *msg, struct recptypes *recp) {
        char roomname[ROOMNAMELEN];
 
        /*
@@ -2429,13 +2354,13 @@ int ical_obj_aftersave(struct CtdlMessage *msg, struct recptypes *recp)
                return(0);      /* Not the Calendar room -- don't do anything. */
        }
 
-       /* It must be an RFC822 message! */
+       // It must be an RFC822 message!
        if (msg->cm_format_type != 4) return(1);
 
-       /* Reject null messages */
+       // Reject null messages
        if (CM_IsEmpty(msg, eMesageText)) return(1);
        
-       /* Now recurse through it looking for our icalendar data */
+       // Now recurse through it looking for our icalendar data
        mime_parser(CM_RANGE(msg, eMesageText),
                    *ical_obj_aftersave_backend,
                    NULL, NULL,
@@ -2458,9 +2383,7 @@ void ical_session_shutdown(void) {
 }
 
 
-/*
- * Back end for ical_fixed_output()
- */
+// Back end for ical_fixed_output()
 void ical_fixed_output_backend(icalcomponent *cal, int recursion_level) {
        icalcomponent *c;
        icalproperty *p;
@@ -2482,35 +2405,33 @@ void ical_fixed_output_backend(icalcomponent *cal, int recursion_level) {
                cprintf("%s\n", (const char *)icalproperty_get_comment(p));
        }
 
-       /* If the component has attendees, iterate through them. */
+       // If the component has attendees, iterate through them.
        for (p = icalcomponent_get_first_property(cal, ICAL_ATTENDEE_PROPERTY); (p != NULL); p = icalcomponent_get_next_property(cal, ICAL_ATTENDEE_PROPERTY)) {
                ch =  icalproperty_get_attendee(p);
                if ((ch != NULL) && 
                    !strncasecmp(ch, "MAILTO:", 7)) {
 
-                       /* screen name or email address */
+                       // screen name or email address
                        safestrncpy(buf, ch + 7, sizeof(buf));
-                       striplt(buf);
+                       string_trim(buf);
                        cprintf("%s ", buf);
                }
                cprintf("\n");
        }
 
-       /* If the component has subcomponents, recurse through them. */
+       // 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 */
+               // Recursively process subcomponent 
                ical_fixed_output_backend(c, recursion_level+1);
        }
 }
 
 
-/*
- * Function to output iCalendar data as plain text.  Nobody uses MSG0
- * anymore, so really this is just so we expose the vCard data to the full
- * text indexer.
- */
+// Function to output iCalendar data as plain text.  Nobody uses MSG0
+// anymore, so really this is just so we expose the vCard data to the full
+// text indexer.
 void ical_fixed_output(char *ptr, int len) {
        icalcomponent *cal;
        char *stringy_cal;
@@ -2526,29 +2447,23 @@ void ical_fixed_output(char *ptr, int len) {
 
        ical_fixed_output_backend(cal, 0);
 
-       /* Free the memory we obtained from libical's constructor */
+       // Free the memory we obtained from libical's constructor
        icalcomponent_free(cal);
 }
 
 
-/*
- * Register this module with the Citadel server.
- */
+// Initialization function, called from modules_init.c
 char *ctdl_module_init_calendar(void) {
        if (!threading) {
 
-               /* Tell libical to return errors instead of aborting if it gets bad data */
-
-#ifdef LIBICAL_ICAL_EXPORT     // cheap and sleazy way to detect libical >=2.0
+               // Tell libical to return errors instead of aborting if it gets bad data.
+               // If this library call is not found, you need to upgrade libical.
                icalerror_set_errors_are_fatal(0);
-#else
-               icalerror_errors_are_fatal = 0;
-#endif
 
-               /* Use our own application prefix in tzid's generated from system tzdata */
+               // Use our own application prefix in tzid's generated from system tzdata
                icaltimezone_set_tzid_prefix("/citadel.org/");
 
-               /* Initialize our hook functions */
+               // Initialize our hook functions
                CtdlRegisterMessageHook(ical_obj_beforesave, EVT_BEFORESAVE);
                CtdlRegisterMessageHook(ical_obj_aftersave, EVT_AFTERSAVE);
                CtdlRegisterSessionHook(ical_CtdlCreateRoom, EVT_LOGIN, PRIO_LOGIN + 1);
@@ -2559,6 +2474,6 @@ char *ctdl_module_init_calendar(void) {
                CtdlRegisterFixedOutputHook("application/ics", ical_fixed_output);
        }
 
-       /* return our module name for the log */
+       // return our module name for the log
        return "calendar";
 }