// Iterate through the attendees looking for a match.
STARTOVER:
for (e_attendee = icalcomponent_get_first_property(event, ICAL_ATTENDEE_PROPERTY);
- e_attendee != NULL;
- e_attendee = icalcomponent_get_next_property(event, ICAL_ATTENDEE_PROPERTY)) {
+ e_attendee != NULL;
+ e_attendee = icalcomponent_get_next_property(event, ICAL_ATTENDEE_PROPERTY)
+ ) {
for (r_attendee = icalcomponent_get_first_property(reply, ICAL_ATTENDEE_PROPERTY);
- r_attendee != NULL;
- r_attendee = icalcomponent_get_next_property(reply, ICAL_ATTENDEE_PROPERTY)) {
+ r_attendee != NULL;
+ r_attendee = icalcomponent_get_next_property(reply, ICAL_ATTENDEE_PROPERTY)
+ ) {
// Check to see if these two attendees match...
const char *e, *r;
}
}
- /* First, check for all-day events */
+ // First, check for all-day events
if (t1start.is_date || t2start.is_date) {
- /* If event 1 ends before event 2 starts, we're in the clear. */
+ // If event 1 ends before event 2 starts, we're in the clear.
if (icaltime_compare_date_only(t1end, t2start) < 0) return(0);
- /* If event 2 ends before event 1 starts, we're also ok. */
+ // If event 2 ends before event 1 starts, we're also ok.
if (icaltime_compare_date_only(t2end, t1start) < 0) return(0);
return(1);
}
- /* syslog(LOG_DEBUG, "Comparing t1start %d:%d t1end %d:%d t2start %d:%d t2end %d:%d",
- t1start.hour, t1start.minute, t1end.hour, t1end.minute,
- t2start.hour, t2start.minute, t2end.hour, t2end.minute);
- */
+ // syslog(LOG_DEBUG, "Comparing t1start %d:%d t1end %d:%d t2start %d:%d t2end %d:%d",
+ // t1start.hour, t1start.minute, t1end.hour, t1end.minute,
+ // t2start.hour, t2start.minute, t2end.hour, t2end.minute);
- /* Now check for overlaps using date *and* time. */
+ // Now check for overlaps using date *and* time.
- /* If event 1 ends before event 2 starts, we're in the clear. */
+ // If event 1 ends before event 2 starts, we're in the clear.
if (icaltime_compare(t1end, t2start) <= 0) return(0);
- /* syslog(LOG_DEBUG, "calendar: first passed"); */
+ // syslog(LOG_DEBUG, "calendar: first passed");
- /* If event 2 ends before event 1 starts, we're also ok. */
+ // If event 2 ends before event 1 starts, we're also ok.
if (icaltime_compare(t2end, t1start) <= 0) return(0);
- /* syslog(LOG_DEBUG, "calendar: second passed"); */
+ // syslog(LOG_DEBUG, "calendar: second passed");
- /* Otherwise, they overlap. */
+ // Otherwise, they overlap.
return(1);
}
-/*
- * Phase 6 of "hunt for conflicts"
- * called by ical_conflicts_phase5()
- *
- * Now both the proposed and existing events have been boiled down to start and end times.
- * Check for overlap and output any conflicts.
- *
- * Returns nonzero if a conflict was reported. This allows the caller to stop iterating.
- */
+// Phase 6 of "hunt for conflicts"
+// called by ical_conflicts_phase5()
+//
+// Now both the proposed and existing events have been boiled down to start and end times.
+// Check for overlap and output any conflicts.
+//
+// Returns nonzero if a conflict was reported. This allows the caller to stop iterating.
int ical_conflicts_phase6(struct icaltimetype t1start,
struct icaltimetype t1end,
struct icaltimetype t2start,
// syslog(LOG_DEBUG, " EXISTING END: %s", ctime(&tt));
// debugging cruft
- /* compare and output */
+ // compare and output
if (ical_ctdl_is_overlap(t1start, t1end, t2start, t2end)) {
cprintf("%ld||%s|%s|%d|\n",
struct icaltimetype t2start, t2end;
icalproperty *p;
- /* recur variables */
+ // recur variables
icalproperty *rrule = NULL;
struct icalrecurrencetype recur;
icalrecur_iterator *ritr = NULL;
struct icaldurationtype dur;
int num_recur = 0;
- /* initialization */
+ // initialization
strcpy(conflict_event_uid, "");
strcpy(conflict_event_summary, "");
t2start = icaltime_null_time();
t2end = icaltime_null_time();
- /* existing event stuff */
+ // existing event stuff
p = ical_ctdl_get_subprop(existing_event, ICAL_DTSTART_PROPERTY);
if (p == NULL) return;
if (p != NULL) t2start = icalproperty_get_dtstart(p);
}
if (ical_conflicts_phase6(t1start, t1end, t2start, t2end,
- existing_msgnum, conflict_event_uid, conflict_event_summary, compare_uid))
- {
- num_recur = MAX_RECUR + 1; /* force it out of scope, no need to continue */
+ existing_msgnum, conflict_event_uid, conflict_event_summary, compare_uid)) {
+ num_recur = MAX_RECUR + 1; // force it out of scope, no need to continue
}
if (rrule) {
}
if (icaltime_compare(t2start, t1end) < 0) {
- num_recur = MAX_RECUR + 1; /* force it out of scope */
+ num_recur = MAX_RECUR + 1; // force it out of scope
}
} while ( (rrule) && (!icaltime_is_null_time(t2start)) && (num_recur < MAX_RECUR) );
}
-/*
- * Phase 4 of "hunt for conflicts"
- * Called by ical_hunt_for_conflicts_backend()
- *
- * At this point we've got it boiled down to two icalcomponent events in memory.
- * If they conflict, output something to the client.
- */
+// Phase 4 of "hunt for conflicts"
+// Called by ical_hunt_for_conflicts_backend()
+//
+// At this point we've got it boiled down to two icalcomponent events in memory.
+// If they conflict, output something to the client.
void ical_conflicts_phase4(icalcomponent *proposed_event,
icalcomponent *existing_event,
long existing_msgnum)
icalproperty *p;
char compare_uid[SIZ];
- /* recur variables */
+ // recur variables
icalproperty *rrule = NULL;
struct icalrecurrencetype recur;
icalrecur_iterator *ritr = NULL;
struct icaldurationtype dur;
int num_recur = 0;
- /* initialization */
+ // initialization
t1end = icaltime_null_time();
*compare_uid = '\0';
- /* proposed event stuff */
+ // proposed event stuff
p = ical_ctdl_get_subprop(proposed_event, ICAL_DTSTART_PROPERTY);
if (p == NULL)
}
-/*
- * Phase 3 of "hunt for conflicts"
- * Called by ical_hunt_for_conflicts()
- */
+// Phase 3 of "hunt for conflicts"
+// Called by ical_hunt_for_conflicts()
void ical_hunt_for_conflicts_backend(long msgnum, void *data) {
icalcomponent *proposed_event;
struct CtdlMessage *msg = NULL;
}
-/*
- * Phase 2 of "hunt for conflicts" operation.
- * At this point we have a calendar object which represents the VEVENT that
- * is proposed for addition to the calendar. Now hunt through the user's
- * calendar room, and output zero or more existing VEVENTs which conflict
- * with this one.
- */
+// Phase 2 of "hunt for conflicts" operation.
+// At this point we have a calendar object which represents the VEVENT that
+// is proposed for addition to the calendar. Now hunt through the user's
+// calendar room, and output zero or more existing VEVENTs which conflict
+// with this one.
void ical_hunt_for_conflicts(icalcomponent *cal) {
char hold_rm[ROOMNAMELEN];
- 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);
);
cprintf("000\n");
- CtdlGetRoom(&CC->room, hold_rm); /* return to saved room */
+ CtdlGetRoom(&CC->room, hold_rm); // return to saved room
}
memset(&ird, 0, sizeof ird);
strcpy(ird.desired_partnum, partnum);
- mime_parser(CM_RANGE(msg, eMessageText),
- *ical_locate_part, /* callback function */
- NULL, NULL,
- (void *) &ird, /* user data */
- 0
- );
+ mime_parser(
+ CM_RANGE(msg, eMessageText),
+ *ical_locate_part, // callback function
+ NULL,
+ NULL,
+ (void *) &ird, // user data
+ 0
+ );
CM_Free(msg);
}
-/*
- * Look for busy time in a VEVENT and add it to the supplied VFREEBUSY.
- *
- * fb The VFREEBUSY component to which we are appending
- * top_level_cal The top-level VCALENDAR component which contains a VEVENT to be added
- */
+// Look for busy time in a VEVENT and add it to the supplied VFREEBUSY.
+//
+// fb The VFREEBUSY component to which we are appending
+// top_level_cal The top-level VCALENDAR component which contains a VEVENT to be added
void ical_add_to_freebusy(icalcomponent *fb, icalcomponent *top_level_cal) {
icalcomponent *cal;
icalproperty *p;
icaltimetype dtstart;
icaltimetype dtend;
- /* recur variables */
+ // recur variables
icalproperty *rrule = NULL;
struct icalrecurrencetype recur;
icalrecur_iterator *ritr = NULL;
if (!top_level_cal) return;
- /* Find the VEVENT component containing an event */
+ // Find the VEVENT component containing an event
cal = icalcomponent_get_first_component(top_level_cal, ICAL_VEVENT_COMPONENT);
if (!cal) return;
- /* If this event is not opaque, the user isn't publishing it as
- * busy time, so don't bother doing anything else.
- */
+ // If this event is not opaque, the user isn't publishing it as
+ // busy time, so don't bother doing anything else.
p = icalcomponent_get_first_property(cal, ICAL_TRANSP_PROPERTY);
if (p != NULL) {
v = icalproperty_get_value(p);
}
}
- /*
- * Now begin calculating the event start and end times.
- */
+ // Now begin calculating the event start and end times.
p = icalcomponent_get_first_property(cal, ICAL_DTSTART_PROPERTY);
if (!p) return;
dtstart = icalproperty_get_dtstart(p);
memset (&dur, 0, sizeof(struct icaldurationtype));
}
- /* Is a recurrence specified? If so, get ready to process it... */
+ // Is a recurrence specified? If so, get ready to process it...
rrule = ical_ctdl_get_subprop(cal, ICAL_RRULE_PROPERTY);
if (rrule) {
recur = icalproperty_get_rrule(rrule);
}
do {
- /* Convert the DTSTART and DTEND properties to an icalperiod. */
+ // Convert the DTSTART and DTEND properties to an icalperiod.
this_event_period.start = dtstart;
if (!icaltime_is_null_time(dtend)) {
this_event_period.end = dtend;
}
- /* Convert the timestamps to UTC. It's ok to do this because we've already expanded
- * recurrences and this data is never going to get used again.
- */
+ // Convert the timestamps to UTC. It's ok to do this because we've already expanded
+ // recurrences and this data is never going to get used again.
this_event_period.start = icaltime_convert_to_zone(
this_event_period.start,
icaltimezone_get_utc_timezone()
icaltimezone_get_utc_timezone()
);
- /* Now add it. */
+ // Now add it.
icalcomponent_add_property(fb, icalproperty_new_freebusy(this_event_period));
- /* Make sure the DTSTART property of the freebusy *list* is set to
- * the DTSTART property of the *earliest event*.
- */
+ // Make sure the DTSTART property of the freebusy *list* is set to
+ // the DTSTART property of the *earliest event*.
p = icalcomponent_get_first_property(fb, ICAL_DTSTART_PROPERTY);
if (p == NULL) {
icalcomponent_set_dtstart(fb, this_event_period.start);
}
}
- /* Make sure the DTEND property of the freebusy *list* is set to
- * the DTEND property of the *latest event*.
- */
+ // Make sure the DTEND property of the freebusy *list* is set to
+ // the DTEND property of the *latest event*.
p = icalcomponent_get_first_property(fb, ICAL_DTEND_PROPERTY);
if (p == NULL) {
icalcomponent_set_dtend(fb, this_event_period.end);
struct CtdlMessage *msg = NULL;
struct ical_respond_data ird;
- fb = (icalcomponent *)data; /* User-supplied data will be the VFREEBUSY component */
+ fb = (icalcomponent *)data; // User-supplied data will be the VFREEBUSY component
msg = CtdlFetchMessage(msgnum, 1);
if (msg == NULL) return;
memset(&ird, 0, sizeof ird);
strcpy(ird.desired_partnum, "_HUNT_");
- mime_parser(CM_RANGE(msg, eMessageText),
- *ical_locate_part, /* callback function */
- NULL, NULL,
- (void *) &ird, /* user data */
- 0
- );
+ mime_parser(
+ CM_RANGE(msg, eMessageText),
+ *ical_locate_part, // callback function
+ NULL,
+ NULL,
+ (void *) &ird, // user data
+ 0
+ );
CM_Free(msg);
if (ird.cal) {
- ical_add_to_freebusy(fb, ird.cal); /* Add VEVENT times to VFREEBUSY */
+ ical_add_to_freebusy(fb, ird.cal); // Add VEVENT times to VFREEBUSY
icalcomponent_free(ird.cal);
}
}
-/*
- * Grab another user's free/busy times
- */
+// Grab another user's free/busy times
void ical_freebusy(char *who) {
struct ctdluser usbuf;
char calendar_room_name[ROOMNAMELEN];
int i = 0;
int config_lines = 0;
- /* First try an exact match. */
+ // First try an exact match.
found_user = CtdlGetUser(&usbuf, who);
- /* If not found, try it as an unqualified email address. */
+ // If not found, try it as an unqualified email address.
if (found_user != 0) {
strcpy(buf, who);
recp = validate_recipients(buf, NULL, 0);
}
}
- /* If still not found, try it as an address qualified with the
- * primary FQDN of this Citadel node.
- */
+ // If still not found, try it as an address qualified with the primary FQDN of this Citadel node.
if (found_user != 0) {
snprintf(buf, sizeof buf, "%s@%s", who, CtdlGetConfigStr("c_fqdn"));
syslog(LOG_DEBUG, "calendar: trying <%s>", buf);
}
}
- /* Still not found? Try qualifying it with every domain we
- * might have addresses in.
- */
+ // Still not found? Try qualifying it with every domain we might have addresses in.
if (found_user != 0) {
config_lines = num_tokens(inetcfg, '\n');
for (i=0; ((i < config_lines) && (found_user != 0)); ++i) {
extract_token(host, buf, 0, '|', sizeof host);
extract_token(type, buf, 1, '|', sizeof type);
- if ( (!strcasecmp(type, "localhost"))
- || (!strcasecmp(type, "directory")) ) {
+ if ( (!strcasecmp(type, "localhost"))
+ || (!strcasecmp(type, "directory"))
+ ) {
snprintf(buf, sizeof buf, "%s@%s", who, host);
syslog(LOG_DEBUG, "calendar: trying <%s>", buf);
recp = validate_recipients(buf, NULL, 0);
return;
}
- CtdlMailboxName(calendar_room_name, sizeof calendar_room_name,
- &usbuf, USERCALENDARROOM);
+ CtdlMailboxName(calendar_room_name, sizeof calendar_room_name, &usbuf, USERCALENDARROOM);
- strcpy(hold_rm, CC->room.QRname); /* save current room */
+ strcpy(hold_rm, CC->room.QRname); // save current room
if (CtdlGetRoom(&CC->room, calendar_room_name) != 0) {
cprintf("%d Cannot open calendar\n", ERROR + ROOM_NOT_FOUND);
return;
}
- /* Create a VFREEBUSY subcomponent */
+ // Create a VFREEBUSY subcomponent
syslog(LOG_DEBUG, "calendar: creating VFREEBUSY component");
fb = icalcomponent_new_vfreebusy();
if (fb == NULL) {
return;
}
- /* Set the method to PUBLISH */
+ // Set the method to PUBLISH
icalcomponent_set_method(fb, ICAL_METHOD_PUBLISH);
- /* Set the DTSTAMP to right now. */
+ // Set the DTSTAMP to right now.
icalcomponent_set_dtstamp(fb, icaltime_from_timet_with_zone(time(NULL), 0, icaltimezone_get_utc_timezone()));
- /* Add the user's email address as ORGANIZER */
+ // Add the user's email address as ORGANIZER
sprintf(buf, "MAILTO:%s", who);
if (strchr(buf, '@') == NULL) {
strcat(buf, "@");
}
icalcomponent_add_property(fb, icalproperty_new_organizer(buf));
- /* Add busy time from events */
+ // Add busy time from events
syslog(LOG_DEBUG, "calendar: adding busy time from events");
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.
- */
+ // If values for DTSTART and DTEND are still not present, set them
+ // to yesterday and tomorrow as default values.
if (icalcomponent_get_first_property(fb, ICAL_DTSTART_PROPERTY) == NULL) {
icalcomponent_set_dtstart(fb, icaltime_from_timet_with_zone(time(NULL)-86400L, 0, icaltimezone_get_utc_timezone()));
}
icalcomponent_set_dtend(fb, icaltime_from_timet_with_zone(time(NULL)+86400L, 0, icaltimezone_get_utc_timezone()));
}
- /* Put the freebusy component into the calendar component */
+ // Put the freebusy component into the calendar component
syslog(LOG_DEBUG, "calendar: encapsulating");
encaps = ical_encapsulate_subcomponent(fb);
if (encaps == NULL) {
return;
}
- /* Set the method to PUBLISH */
+ // Set the method to PUBLISH
syslog(LOG_DEBUG, "calendar: setting method");
icalcomponent_set_method(encaps, ICAL_METHOD_PUBLISH);
- /* Serialize it */
+ // Serialize it
syslog(LOG_DEBUG, "calendar: serializing");
serialized_request = icalcomponent_as_ical_string_r(encaps);
- icalcomponent_free(encaps); /* Don't need this anymore. */
+ icalcomponent_free(encaps); // Don't need this anymore.
cprintf("%d Free/busy for %s\n", LISTING_FOLLOWS, usbuf.fullname);
if (serialized_request != NULL) {
}
cprintf("\n000\n");
- /* Go back to the room from which we came... */
+ // Go back to the room from which we came...
CtdlGetRoom(&CC->room, hold_rm);
}
if (msg == NULL) return;
memset(&ird, 0, sizeof ird);
strcpy(ird.desired_partnum, "_HUNT_");
- mime_parser(CM_RANGE(msg, eMessageText),
- *ical_locate_part, /* callback function */
- NULL, NULL,
- (void *) &ird, /* user data */
- 0
+ mime_parser(
+ CM_RANGE(msg, eMessageText),
+ *ical_locate_part, /* callback function */
+ NULL,
+ NULL,
+ (void *) &ird, /* user data */
+ 0
);
CM_Free(msg);
*/
else {
for (c = icalcomponent_get_first_component(ird.cal, ICAL_ANY_COMPONENT);
- (c != NULL);
- c = icalcomponent_get_next_component(ird.cal, ICAL_ANY_COMPONENT)) {
+ (c != NULL);
+ c = icalcomponent_get_next_component(ird.cal, ICAL_ANY_COMPONENT)
+ ) {
/* For VTIMEZONE components, suppress duplicates of the same tzid */
/* Non-VTIMEZONE components each get written as individual messages.
* But we also need to attach the relevant VTIMEZONE components to them.
*/
- if ( (icalcomponent_isa(c) != ICAL_VTIMEZONE_COMPONENT)
- && (encaps = icalcomponent_new_vcalendar()) ) {
+ if ( (icalcomponent_isa(c) != ICAL_VTIMEZONE_COMPONENT)
+ && (encaps = icalcomponent_new_vcalendar())
+ ) {
icalcomponent_add_property(encaps, icalproperty_new_prodid(PRODID));
icalcomponent_add_property(encaps, icalproperty_new_version("2.0"));
icalcomponent_set_method(encaps, ICAL_METHOD_PUBLISH);
/* Look for properties containing timezone parameters, to see if we need to attach VTIMEZONEs */
for (p = icalcomponent_get_first_property(the_request, ICAL_ANY_PROPERTY);
- p != NULL;
- p = icalcomponent_get_next_property(the_request, ICAL_ANY_PROPERTY))
- {
- if ( (icalproperty_isa(p) == ICAL_COMPLETED_PROPERTY)
- || (icalproperty_isa(p) == ICAL_CREATED_PROPERTY)
- || (icalproperty_isa(p) == ICAL_DATEMAX_PROPERTY)
- || (icalproperty_isa(p) == ICAL_DATEMIN_PROPERTY)
- || (icalproperty_isa(p) == ICAL_DTEND_PROPERTY)
- || (icalproperty_isa(p) == ICAL_DTSTAMP_PROPERTY)
- || (icalproperty_isa(p) == ICAL_DTSTART_PROPERTY)
- || (icalproperty_isa(p) == ICAL_DUE_PROPERTY)
- || (icalproperty_isa(p) == ICAL_EXDATE_PROPERTY)
- || (icalproperty_isa(p) == ICAL_LASTMODIFIED_PROPERTY)
- || (icalproperty_isa(p) == ICAL_MAXDATE_PROPERTY)
- || (icalproperty_isa(p) == ICAL_MINDATE_PROPERTY)
- || (icalproperty_isa(p) == ICAL_RECURRENCEID_PROPERTY)
+ p != NULL;
+ p = icalcomponent_get_next_property(the_request, ICAL_ANY_PROPERTY)
+ ) {
+ if ( (icalproperty_isa(p) == ICAL_COMPLETED_PROPERTY)
+ || (icalproperty_isa(p) == ICAL_CREATED_PROPERTY)
+ || (icalproperty_isa(p) == ICAL_DATEMAX_PROPERTY)
+ || (icalproperty_isa(p) == ICAL_DATEMIN_PROPERTY)
+ || (icalproperty_isa(p) == ICAL_DTEND_PROPERTY)
+ || (icalproperty_isa(p) == ICAL_DTSTAMP_PROPERTY)
+ || (icalproperty_isa(p) == ICAL_DTSTART_PROPERTY)
+ || (icalproperty_isa(p) == ICAL_DUE_PROPERTY)
+ || (icalproperty_isa(p) == ICAL_EXDATE_PROPERTY)
+ || (icalproperty_isa(p) == ICAL_LASTMODIFIED_PROPERTY)
+ || (icalproperty_isa(p) == ICAL_MAXDATE_PROPERTY)
+ || (icalproperty_isa(p) == ICAL_MINDATE_PROPERTY)
+ || (icalproperty_isa(p) == ICAL_RECURRENCEID_PROPERTY)
) {
t = icalproperty_get_dtstart(p); // it's safe to use dtstart for all of them
/* If the component has subcomponents, recurse through them. */
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)
+ ) {
/* Recursively process subcomponent */
ical_saving_vevent(top_level_cal, c);
}
if (!msg) return;
/* We're only interested in calendar data. */
- if ( (strcasecmp(cbtype, "text/calendar"))
- && (strcasecmp(cbtype, "application/ics")) ) {
+ if ( (strcasecmp(cbtype, "text/calendar"))
+ && (strcasecmp(cbtype, "application/ics"))
+ ) {
return;
}
- /* Hunt for the UID and drop it in
- * the "user data" pointer for the MIME parser. When
- * ical_obj_beforesave() sees it there, it'll set the Exclusive msgid
- * to that string.
- */
+ // Hunt for the UID and drop it in the "user data" pointer for the MIME parser.
+ // When ical_obj_beforesave() sees it there, it'll set the Exclusive msgid to that string.
whole_cal = icalcomponent_new_from_string(content);
cal = whole_cal;
if (cal != NULL) {
if (icalcomponent_isa(cal) == ICAL_VCALENDAR_COMPONENT) {
- nested_event = icalcomponent_get_first_component(
- cal, ICAL_VEVENT_COMPONENT);
+ nested_event = icalcomponent_get_first_component(cal, ICAL_VEVENT_COMPONENT);
if (nested_event != NULL) {
cal = nested_event;
}
else {
- nested_todo = icalcomponent_get_first_component(
- cal, ICAL_VTODO_COMPONENT);
+ nested_todo = icalcomponent_get_first_component( cal, ICAL_VTODO_COMPONENT);
if (nested_todo != NULL) {
cal = nested_todo;
}
}
}
-
+
if (cal != NULL) {
/* Set the message EUID to the iCalendar UID */
*/
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)
+ if ( (CC->room.QRdefaultview != VIEW_CALENDAR)
+ && (CC->room.QRdefaultview != VIEW_TASKS)
) {
return(0); /* Not an iCalendar-centric room */
}
}
/* Do all of our lovely back-end parsing */
- mime_parser(CM_RANGE(msg, eMessageText),
- *ical_obj_beforesave_backend,
- NULL, NULL,
- (void *)msg,
- 0
- );
+ mime_parser(
+ CM_RANGE(msg, eMessageText),
+ *ical_obj_beforesave_backend,
+ NULL,
+ NULL,
+ (void *)msg,
+ 0
+ );
return(0);
}
icalcomponent *cal;
/* We're only interested in calendar items here. */
- if ( (strcasecmp(cbtype, "text/calendar"))
- && (strcasecmp(cbtype, "application/ics")) ) {
+ if ( (strcasecmp(cbtype, "text/calendar"))
+ && (strcasecmp(cbtype, "application/ics"))
+ ) {
return;
}
* ical_obj_beforesave() sees it there, it'll set the Exclusive msgid
* to that string.
*/
- if ( (!strcasecmp(cbtype, "text/calendar"))
- || (!strcasecmp(cbtype, "application/ics")) ) {
+ if ( (!strcasecmp(cbtype, "text/calendar"))
+ || (!strcasecmp(cbtype, "application/ics"))
+ ) {
cal = icalcomponent_new_from_string(content);
if (cal != NULL) {
ical_saving_vevent(cal, cal);
if (CM_IsEmpty(msg, eMessageText)) return(1);
// Now recurse through it looking for our icalendar data
- mime_parser(CM_RANGE(msg, eMessageText),
- *ical_obj_aftersave_backend,
- NULL, NULL,
- NULL,
- 0
- );
+ mime_parser(
+ CM_RANGE(msg, eMessageText),
+ *ical_obj_aftersave_backend,
+ NULL,
+ NULL,
+ NULL,
+ 0
+ );
return(0);
}
char buf[256];
const char *ch;
- p = icalcomponent_get_first_property(cal, ICAL_SUMMARY_PROPERTY);
+ p = icalcomponent_get_first_property(cal, ICAL_SUMMARY_PROPERTY);
if (p != NULL) {
cprintf("%s\n", (const char *)icalproperty_get_comment(p));
}
- p = icalcomponent_get_first_property(cal, ICAL_LOCATION_PROPERTY);
+ p = icalcomponent_get_first_property(cal, ICAL_LOCATION_PROPERTY);
if (p != NULL) {
cprintf("%s\n", (const char *)icalproperty_get_comment(p));
}
- p = icalcomponent_get_first_property(cal, ICAL_DESCRIPTION_PROPERTY);
+ p = icalcomponent_get_first_property(cal, ICAL_DESCRIPTION_PROPERTY);
if (p != NULL) {
cprintf("%s\n", (const char *)icalproperty_get_comment(p));
}
// 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)) {
+ if ((ch != NULL) && !strncasecmp(ch, "MAILTO:", 7)) {
// screen name or email address
safestrncpy(buf, ch + 7, sizeof(buf));
// 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)) {
+ (c != 0);
+ c = icalcomponent_get_next_component(cal, ICAL_ANY_COMPONENT)
+ ) {
// Recursively process subcomponent
ical_fixed_output_backend(c, recursion_level+1);
}