X-Git-Url: https://code.citadel.org/?p=citadel.git;a=blobdiff_plain;f=citadel%2Fmodules%2Fcalendar%2Fserv_calendar.c;h=c38ffd250b5c1103cff240adebe9f03be68f8929;hp=71c7fbc519fb52ad2efed92b3792f36e7a847f9b;hb=5ac2920028e92a453c686c799327d7a66b3e7b49;hpb=a7d7e3f128e15f282f2a96aba513823aa9603c22 diff --git a/citadel/modules/calendar/serv_calendar.c b/citadel/modules/calendar/serv_calendar.c index 71c7fbc51..c38ffd250 100644 --- a/citadel/modules/calendar/serv_calendar.c +++ b/citadel/modules/calendar/serv_calendar.c @@ -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-2020 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. @@ -17,9 +17,7 @@ #define PRODID "-//Citadel//NONSGML Citadel Calendar//EN" #include "ctdl_module.h" - #include - #include "msgbase.h" #include "internet_addressing.h" #include "serv_calendar.h" @@ -28,7 +26,6 @@ #include "default_timezone.h" #include "config.h" - struct ical_respond_data { char desired_partnum[SIZ]; icalcomponent *cal; @@ -140,7 +137,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); @@ -310,7 +306,6 @@ 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 @@ -570,8 +565,6 @@ STARTOVER: } - - /* * Handle an incoming RSVP (object with method==ICAL_METHOD_REPLY) for a * calendar event. The object has already been deserialized for us; all @@ -863,6 +856,7 @@ int ical_ctdl_is_overlap( return(1); } + /* * Phase 6 of "hunt for conflicts" * called by ical_conflicts_phase5() @@ -914,7 +908,6 @@ int ical_conflicts_phase6(struct icaltimetype t1start, } - /* * Phase 5 of "hunt for conflicts" * Called by ical_conflicts_phase4() @@ -1029,8 +1022,6 @@ void ical_conflicts_phase5(struct icaltimetype t1start, } - - /* * Phase 4 of "hunt for conflicts" * Called by ical_hunt_for_conflicts_backend() @@ -1132,7 +1123,6 @@ void ical_conflicts_phase4(icalcomponent *proposed_event, } - /* * Phase 3 of "hunt for conflicts" * Called by ical_hunt_for_conflicts() @@ -1163,7 +1153,6 @@ void ical_hunt_for_conflicts_backend(long msgnum, void *data) { } - /* * Phase 2 of "hunt for conflicts" operation. * At this point we have a calendar object which represents the VEVENT that @@ -1197,7 +1186,6 @@ void ical_hunt_for_conflicts(icalcomponent *cal) { } - /* * Hunt for conflicts (Phase 1 -- retrieve the object and call Phase 2) */ @@ -1235,7 +1223,6 @@ void ical_conflicts(long msgnum, char *partnum) { } - /* * Look for busy time in a VEVENT and add it to the supplied VFREEBUSY. * @@ -1375,7 +1362,6 @@ void ical_add_to_freebusy(icalcomponent *fb, icalcomponent *top_level_cal) { } - /* * Backend for ical_freebusy() * @@ -1410,7 +1396,6 @@ void ical_freebusy_backend(long msgnum, void *data) { } - /* * Grab another user's free/busy times */ @@ -1573,7 +1558,6 @@ void ical_freebusy(char *who) { } - /* * Backend for ical_getics() * @@ -1647,7 +1631,6 @@ 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. @@ -1856,10 +1839,8 @@ void cmd_ical(char *argbuf) } if (!strcasecmp(subcmd, "sgi")) { - CIT_ICAL->server_generated_invitations = - (extract_int(argbuf, 1) ? 1 : 0) ; - cprintf("%d %d\n", - CIT_OK, CIT_ICAL->server_generated_invitations); + CIT_ICAL->server_generated_invitations = (extract_int(argbuf, 1) ? 1 : 0) ; + cprintf("%d %d\n", CIT_OK, CIT_ICAL->server_generated_invitations); return; } @@ -1902,7 +1883,6 @@ void cmd_ical(char *argbuf) } - /* * We don't know if the calendar room exists so we just create it at login */ @@ -2003,7 +1983,6 @@ void ical_send_out_invitations(icalcomponent *top_level_cal, icalcomponent *cal) return; } - /* If this is a VCALENDAR component, look for a VEVENT subcomponent. */ if (icalcomponent_isa(cal) == ICAL_VCALENDAR_COMPONENT) { ical_send_out_invitations(top_level_cal, @@ -2141,8 +2120,7 @@ void ical_send_out_invitations(icalcomponent *top_level_cal, icalcomponent *cal) attached_zones[num_zones_attached++] = z; } - icalproperty_set_parameter(p, - icalparameter_new_tzid(icaltimezone_get_tzid(z)) + icalproperty_set_parameter(p, icalparameter_new_tzid(icaltimezone_get_tzid(z)) ); } } @@ -2265,7 +2243,6 @@ void ical_saving_vevent(icalcomponent *top_level_cal, icalcomponent *cal) { } - /* * Back end for ical_obj_beforesave() * This hunts for the UID of the calendar event (becomes Citadel msg EUID), @@ -2365,8 +2342,6 @@ void ical_obj_beforesave_backend(char *name, char *filename, char *partnum, } - - /* * See if we need to prevent the object from being saved (we don't allow * MIME types other than text/calendar in "calendar" or "tasks" rooms). @@ -2478,6 +2453,7 @@ void ical_session_startup(void) { memset(CIT_ICAL, 0, sizeof(struct cit_ical)); } + void ical_session_shutdown(void) { free(CIT_ICAL); } @@ -2486,9 +2462,7 @@ void ical_session_shutdown(void) { /* * Back end for ical_fixed_output() */ -void ical_fixed_output_backend(icalcomponent *cal, - int recursion_level -) { +void ical_fixed_output_backend(icalcomponent *cal, int recursion_level) { icalcomponent *c; icalproperty *p; char buf[256]; @@ -2533,7 +2507,6 @@ void ical_fixed_output_backend(icalcomponent *cal, } - /* * 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 @@ -2559,8 +2532,7 @@ void ical_fixed_output(char *ptr, int len) { } -void serv_calendar_destroy(void) -{ +void serv_calendar_destroy(void) { icaltimezone_free_builtin_timezones(); } @@ -2588,7 +2560,7 @@ CTDL_MODULE_INIT(calendar) CtdlRegisterMessageHook(ical_obj_beforesave, EVT_BEFORESAVE); CtdlRegisterMessageHook(ical_obj_aftersave, EVT_AFTERSAVE); CtdlRegisterSessionHook(ical_CtdlCreateRoom, EVT_LOGIN, PRIO_LOGIN + 1); - CtdlRegisterProtoHook(cmd_ical, "ICAL", "Citadel iCal commands"); + CtdlRegisterProtoHook(cmd_ical, "ICAL", "Citadel iCalendar commands"); CtdlRegisterSessionHook(ical_session_startup, EVT_START, PRIO_START + 1); CtdlRegisterSessionHook(ical_session_shutdown, EVT_STOP, PRIO_STOP + 80); CtdlRegisterFixedOutputHook("text/calendar", ical_fixed_output);