4 * Functions which handle calendar objects and their processing/display.
11 #ifndef WEBCIT_WITH_CALENDAR_SERVICE
14 * Handler stubs for builds with no calendar library available
16 void cal_process_attachment(char *part_source, long msgnum, char *cal_partnum) {
18 wprintf(_("<I>This message contains calendaring/scheduling information,"
19 " but support for calendars is not available on this "
20 "particular system. Please ask your system administrator to "
21 "install a new version of the Citadel web service with "
22 "calendaring enabled.</I><br />\n")
27 void display_calendar(long msgnum) {
29 "Cannot display calendar item. You are seeing this error "
30 "because your WebCit service has not been installed with "
31 "calendar support. Please contact your system administrator."
35 void display_task(long msgnum) {
37 "Cannot display to-do item. You are seeing this error "
38 "because your WebCit service has not been installed with "
39 "calendar support. Please contact your system administrator."
43 #else /* WEBCIT_WITH_CALENDAR_SERVICE */
46 /****** End of handler stubs. Everything below this line is real. ******/
52 * Process a calendar object
53 * ...at this point it's already been deserialized by cal_process_attachment()
56 void cal_process_object(icalcomponent *cal,
62 icalproperty *method = NULL;
63 icalproperty_method the_method = ICAL_METHOD_NONE;
65 struct icaltimetype t;
68 char conflict_name[256];
69 char conflict_message[256];
72 /* Leading HTML for the display of this object */
73 if (recursion_level == 0) {
74 wprintf("<CENTER><TABLE border=0>\n");
77 /* Look for a method */
78 method = icalcomponent_get_first_property(cal, ICAL_METHOD_PROPERTY);
80 /* See what we need to do with this */
82 the_method = icalproperty_get_method(method);
84 case ICAL_METHOD_REQUEST:
85 wprintf("<tr><td colspan=\"2\">\n"
86 "<img align=\"center\" "
87 "src=\"/static/calarea_48x.gif\">"
90 wprintf(_("Meeting invitation"));
91 wprintf("</B></TD></TR>\n");
93 case ICAL_METHOD_REPLY:
94 wprintf("<TR><TD COLSPAN=2>\n"
96 "SRC=\"/static/calarea_48x.gif\">"
99 wprintf(_("Attendee's reply to your invitation"));
100 wprintf("</B></TD></TR>\n");
102 case ICAL_METHOD_PUBLISH:
103 wprintf("<TR><TD COLSPAN=2>\n"
105 "SRC=\"/static/calarea_48x.gif\">"
108 wprintf(_("Published event"));
109 wprintf("</B></TD></TR>\n");
112 wprintf("<TR><TD COLSPAN=2>");
113 wprintf(_("This is an unknown type of calendar item."));
114 wprintf("</TD></TR>\n");
119 p = icalcomponent_get_first_property(cal, ICAL_SUMMARY_PROPERTY);
121 wprintf("<TR><TD><B>");
122 wprintf(_("Summary:"));
123 wprintf("</B></TD><TD>");
124 escputs((char *)icalproperty_get_comment(p));
125 wprintf("</TD></TR>\n");
128 p = icalcomponent_get_first_property(cal, ICAL_LOCATION_PROPERTY);
130 wprintf("<TR><TD><B>");
131 wprintf(_("Location:"));
132 wprintf("</B></TD><TD>");
133 escputs((char *)icalproperty_get_comment(p));
134 wprintf("</TD></TR>\n");
138 * Only show start/end times if we're actually looking at the VEVENT
139 * component. Otherwise it shows bogus dates for things like timezone.
141 if (icalcomponent_isa(cal) == ICAL_VEVENT_COMPONENT) {
143 p = icalcomponent_get_first_property(cal,
144 ICAL_DTSTART_PROPERTY);
146 t = icalproperty_get_dtstart(p);
149 wprintf("<TR><TD><B>");
151 wprintf("</B></TD><TD>"
152 "%s %d, %d</TD></TR>",
158 tt = icaltime_as_timet(t);
159 fmt_date(buf, tt, 0);
160 wprintf("<TR><TD><B>");
161 wprintf(_("Starting date/time:"));
162 wprintf("</B></TD><TD>%s</TD></TR>", buf);
166 p = icalcomponent_get_first_property(cal, ICAL_DTEND_PROPERTY);
168 t = icalproperty_get_dtend(p);
169 tt = icaltime_as_timet(t);
170 fmt_date(buf, tt, 0);
171 wprintf("<TR><TD><B>");
172 wprintf(_("Ending date/time:"));
173 wprintf("</B></TD><TD>%s</TD></TR>", buf);
178 p = icalcomponent_get_first_property(cal, ICAL_DESCRIPTION_PROPERTY);
180 wprintf("<TR><TD><B>");
181 wprintf(_("Description:"));
182 wprintf("</B></TD><TD>");
183 escputs((char *)icalproperty_get_comment(p));
184 wprintf("</TD></TR>\n");
187 /* If the component has attendees, iterate through them. */
188 for (p = icalcomponent_get_first_property(cal, ICAL_ATTENDEE_PROPERTY); (p != NULL); p = icalcomponent_get_next_property(cal, ICAL_ATTENDEE_PROPERTY)) {
189 wprintf("<TR><TD><B>");
190 wprintf(_("Attendee:"));
191 wprintf("</B></TD><TD>");
192 safestrncpy(buf, icalproperty_get_attendee(p), sizeof buf);
193 if (!strncasecmp(buf, "MAILTO:", 7)) {
195 /* screen name or email address */
196 strcpy(buf, &buf[7]);
201 /* participant status */
202 partstat_as_string(buf, p);
205 wprintf("</TD></TR>\n");
208 /* If the component has subcomponents, recurse through them. */
209 for (c = icalcomponent_get_first_component(cal, ICAL_ANY_COMPONENT);
211 c = icalcomponent_get_next_component(cal, ICAL_ANY_COMPONENT)) {
212 /* Recursively process subcomponent */
213 cal_process_object(c, recursion_level+1, msgnum, cal_partnum);
216 /* If this is a REQUEST, display conflicts and buttons */
217 if (the_method == ICAL_METHOD_REQUEST) {
219 /* Check for conflicts */
220 lprintf(9, "Checking server calendar for conflicts...\n");
221 serv_printf("ICAL conflicts|%ld|%s|", msgnum, cal_partnum);
222 serv_getln(buf, sizeof buf);
224 while (serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
225 extract_token(conflict_name, buf, 3, '|', sizeof conflict_name);
226 is_update = extract_int(buf, 4);
229 snprintf(conflict_message, sizeof conflict_message,
230 _("This is an update of '%s' which is already in your calendar."), conflict_name);
233 snprintf(conflict_message, sizeof conflict_message,
234 _("This event would conflict with '%s' which is already in your calendar."), conflict_name);
237 wprintf("<TR><TD><B><I>%s</I></B></TD><td>",
243 escputs(conflict_message);
244 wprintf("</TD></TR>\n");
247 lprintf(9, "...done.\n");
249 /* Display the Accept/Decline buttons */
250 wprintf("<TR><TD>How would you like to respond to this invitation?</td>"
252 "<A HREF=\"/respond_to_request?msgnum=%ld&cal_partnum=%s&sc=Accept\">Accept</a>"
254 "<A HREF=\"/respond_to_request?msgnum=%ld&cal_partnum=%s&sc=Tentative\">Tentative</a>"
256 "<A HREF=\"/respond_to_request?msgnum=%ld&cal_partnum=%s&sc=Decline\">Decline</a>"
257 "</FONT></TD></TR>\n",
265 /* If this is a REPLY, display update button */
266 if (the_method == ICAL_METHOD_REPLY) {
269 * In the future, if we want to validate this object before
270 * continuing, we can do it this way:
271 serv_printf("ICAL whatever|%ld|%s|", msgnum, cal_partnum);
272 serv_getln(buf, sizeof buf);
276 /* Display the update buttons */
278 "Click <i>Update</i> to accept this reply and "
279 "update your calendar."
280 "</td><td><font size=+1>"
281 "<a href=\"/handle_rsvp?msgnum=%ld&cal_partnum=%s&sc=Update\">Update</a>"
283 "<a href=\"/handle_rsvp?msgnum=%ld&cal_partnum=%s&sc=Ignore\">Ignore</a>"
292 /* Trailing HTML for the display of this object */
293 if (recursion_level == 0) {
295 wprintf("</TR></TABLE></CENTER>\n");
301 * Deserialize a calendar object in a message so it can be processed.
302 * (This is the main entry point for these things)
304 void cal_process_attachment(char *part_source, long msgnum, char *cal_partnum) {
307 cal = icalcomponent_new_from_string(part_source);
310 wprintf("Error parsing calendar object<br />\n");
315 cal_process_object(cal, 0, msgnum, cal_partnum);
317 /* Free the memory we obtained from libical's constructor */
318 icalcomponent_free(cal);
325 * Respond to a meeting request
327 void respond_to_request(void) {
330 output_headers(1, 1, 2, 0, 0, 0, 0);
332 wprintf("<div id=\"banner\">\n");
333 wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR><TD>"
334 "<SPAN CLASS=\"titlebar\">Respond to meeting request</SPAN>"
335 "</TD></TR></TABLE>\n"
337 wprintf("</div>\n<div id=\"content\">\n");
339 serv_printf("ICAL respond|%s|%s|%s|",
344 serv_getln(buf, sizeof buf);
347 wprintf("<TABLE BORDER=0><TR><TD>"
348 "<IMG SRC=\"static/calarea_48x.gif\" ALIGN=CENTER>"
351 if (!strcasecmp(bstr("sc"), "accept")) {
352 wprintf("You have accepted this meeting invitation. "
353 "It has been entered into your calendar, "
355 } else if (!strcasecmp(bstr("sc"), "tentative")) {
356 wprintf("You have tentatively accepted this meeting invitation. "
357 "It has been 'pencilled in' to your calendar, "
359 } else if (!strcasecmp(bstr("sc"), "decline")) {
360 wprintf("You have declined this meeting invitation. "
361 "It has <b>not</b> been entered into your calendar, "
364 wprintf("and a reply has been sent to the meeting organizer."
365 "</TD></TR></TABLE>\n"
368 wprintf("<IMG SRC=\"static/error.gif\" ALIGN=CENTER>"
372 wprintf("<A HREF=\"/dotskip?room=");
373 urlescputs(WC->wc_roomname);
374 wprintf("\"><br />Return to messages</A><br />\n");
382 * Handle an incoming RSVP
384 void handle_rsvp(void) {
387 output_headers(1, 1, 2, 0, 0, 0, 0);
389 wprintf("<div id=\"banner\">\n");
390 wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR><TD>"
391 "<SPAN CLASS=\"titlebar\">"
392 "Update your calendar with this RSVP</SPAN>"
393 "</TD></TR></TABLE>\n"
394 "</div>\n<div id=\"content\">\n"
397 serv_printf("ICAL handle_rsvp|%s|%s|%s|",
402 serv_getln(buf, sizeof buf);
405 wprintf("<TABLE BORDER=0><TR><TD>"
406 "<IMG SRC=\"static/calarea_48x.gif\" ALIGN=CENTER>"
409 if (!strcasecmp(bstr("sc"), "update")) {
410 wprintf("Your calendar has been updated "
411 "to reflect this RSVP."
413 } else if (!strcasecmp(bstr("sc"), "ignore")) {
414 wprintf("You have chosen to ignore this RSVP. "
415 "Your calendar has <b>not</b> been updated."
418 wprintf("</TD></TR></TABLE>\n"
421 wprintf("<IMG SRC=\"static/error.gif\" ALIGN=CENTER>"
425 wprintf("<A HREF=\"/dotskip?room=");
426 urlescputs(WC->wc_roomname);
427 wprintf("\"><br />Return to messages</A><br />\n");
435 /*****************************************************************************/
440 * Display handlers for message reading
446 * If we're reading calendar items, just store them for now. We have to
447 * sort and re-output them later when we draw the calendar.
449 void display_individual_cal(icalcomponent *cal, long msgnum) {
453 WC->disp_cal = realloc(WC->disp_cal,
454 (sizeof(struct disp_cal) * WC->num_cal) );
455 WC->disp_cal[WC->num_cal - 1].cal = icalcomponent_new_clone(cal);
457 WC->disp_cal[WC->num_cal - 1].cal_msgnum = msgnum;
463 * Display a task by itself (for editing)
466 void display_edit_individual_task(icalcomponent *supplied_vtodo, long msgnum) {
467 icalcomponent *vtodo;
469 struct icaltimetype t;
471 int created_new_vtodo = 0;
475 if (supplied_vtodo != NULL) {
476 vtodo = supplied_vtodo;
478 /* If we're looking at a fully encapsulated VCALENDAR
479 * rather than a VTODO component, attempt to use the first
480 * relevant VTODO subcomponent. If there is none, the
481 * NULL returned by icalcomponent_get_first_component() will
482 * tell the next iteration of this function to create a
485 if (icalcomponent_isa(vtodo) == ICAL_VCALENDAR_COMPONENT) {
486 display_edit_individual_task(
487 icalcomponent_get_first_component(
488 vtodo, ICAL_VTODO_COMPONENT
495 vtodo = icalcomponent_new(ICAL_VTODO_COMPONENT);
496 created_new_vtodo = 1;
499 output_headers(1, 1, 2, 0, 0, 0, 0);
500 wprintf("<div id=\"banner\">\n"
501 "<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR>"
502 "<TD><IMG SRC=\"/static/taskmanag_48x.gif\"></TD>"
503 "<td><SPAN CLASS=\"titlebar\">Edit task</SPAN>"
504 "</TD></TR></TABLE>\n"
505 "</div>\n<div id=\"content\">\n"
508 wprintf("<div id=\"fix_scrollbar_bug\">"
509 "<table border=0 width=100%% bgcolor=\"#ffffff\"><tr><td>");
511 wprintf("<FORM METHOD=\"POST\" ACTION=\"/save_task\">\n");
512 wprintf("<INPUT TYPE=\"hidden\" NAME=\"msgnum\" VALUE=\"%ld\">\n",
515 wprintf("<TABLE border=0>\n");
517 wprintf("<TR><TD>Summary:</TD><TD>"
518 "<INPUT TYPE=\"text\" NAME=\"summary\" "
519 "MAXLENGTH=\"64\" SIZE=\"64\" VALUE=\"");
520 p = icalcomponent_get_first_property(vtodo, ICAL_SUMMARY_PROPERTY);
522 escputs((char *)icalproperty_get_comment(p));
524 wprintf("\"></TD></TR>\n");
526 wprintf("<TR><TD>Start date:</TD><TD>");
527 p = icalcomponent_get_first_property(vtodo, ICAL_DTSTART_PROPERTY);
529 t = icalproperty_get_dtstart(p);
532 t = icaltime_from_timet(now, 0);
534 display_icaltimetype_as_webform(&t, "dtstart");
535 wprintf("</TD></TR>\n");
537 wprintf("<TR><TD>Due date:</TD><TD>");
538 p = icalcomponent_get_first_property(vtodo, ICAL_DUE_PROPERTY);
540 t = icalproperty_get_due(p);
543 t = icaltime_from_timet(now, 0);
545 display_icaltimetype_as_webform(&t, "due");
546 wprintf("</TD></TR>\n");
547 wprintf("<TR><TD>Description:</TD><TD>");
548 wprintf("<TEXTAREA NAME=\"description\" wrap=soft "
549 "ROWS=10 COLS=80 WIDTH=80>\n"
551 p = icalcomponent_get_first_property(vtodo, ICAL_DESCRIPTION_PROPERTY);
553 escputs((char *)icalproperty_get_comment(p));
555 wprintf("</TEXTAREA></TD></TR></TABLE>\n");
558 "<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Save\">"
560 "<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Delete\">\n"
562 "<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">\n"
566 wprintf("</FORM>\n");
568 wprintf("</td></tr></table></div>\n");
571 if (created_new_vtodo) {
572 icalcomponent_free(vtodo);
577 * Save an edited task
580 void save_individual_task(icalcomponent *supplied_vtodo, long msgnum) {
582 int delete_existing = 0;
584 icalcomponent *vtodo, *encaps;
585 int created_new_vtodo = 0;
588 struct icaltimetype t;
590 if (supplied_vtodo != NULL) {
591 vtodo = supplied_vtodo;
592 /* If we're looking at a fully encapsulated VCALENDAR
593 * rather than a VTODO component, attempt to use the first
594 * relevant VTODO subcomponent. If there is none, the
595 * NULL returned by icalcomponent_get_first_component() will
596 * tell the next iteration of this function to create a
599 if (icalcomponent_isa(vtodo) == ICAL_VCALENDAR_COMPONENT) {
600 save_individual_task(
601 icalcomponent_get_first_component(
602 vtodo, ICAL_VTODO_COMPONENT
609 vtodo = icalcomponent_new(ICAL_VTODO_COMPONENT);
610 created_new_vtodo = 1;
613 if (!strcasecmp(bstr("sc"), "Save")) {
615 /* Replace values in the component with ones from the form */
617 while (prop = icalcomponent_get_first_property(vtodo,
618 ICAL_SUMMARY_PROPERTY), prop != NULL) {
619 icalcomponent_remove_property(vtodo, prop);
620 icalproperty_free(prop);
622 icalcomponent_add_property(vtodo,
623 icalproperty_new_summary(bstr("summary")));
625 while (prop = icalcomponent_get_first_property(vtodo,
626 ICAL_DESCRIPTION_PROPERTY), prop != NULL) {
627 icalcomponent_remove_property(vtodo, prop);
628 icalproperty_free(prop);
630 icalcomponent_add_property(vtodo,
631 icalproperty_new_description(bstr("description")));
633 while (prop = icalcomponent_get_first_property(vtodo,
634 ICAL_DTSTART_PROPERTY), prop != NULL) {
635 icalcomponent_remove_property(vtodo, prop);
636 icalproperty_free(prop);
638 icaltime_from_webform(&t, "dtstart");
639 icalcomponent_add_property(vtodo,
640 icalproperty_new_dtstart(t)
643 while (prop = icalcomponent_get_first_property(vtodo,
644 ICAL_DUE_PROPERTY), prop != NULL) {
645 icalcomponent_remove_property(vtodo, prop);
646 icalproperty_free(prop);
648 icaltime_from_webform(&t, "due");
649 icalcomponent_add_property(vtodo,
650 icalproperty_new_due(t)
653 /* Give this task a UID if it doesn't have one. */
654 lprintf(9, "Give this task a UID if it doesn't have one.\n");
655 if (icalcomponent_get_first_property(vtodo,
656 ICAL_UID_PROPERTY) == NULL) {
658 icalcomponent_add_property(vtodo,
659 icalproperty_new_uid(buf)
663 /* Increment the sequence ID */
664 lprintf(9, "Increment the sequence ID\n");
665 while (prop = icalcomponent_get_first_property(vtodo,
666 ICAL_SEQUENCE_PROPERTY), (prop != NULL) ) {
667 i = icalproperty_get_sequence(prop);
668 lprintf(9, "Sequence was %d\n", i);
669 if (i > sequence) sequence = i;
670 icalcomponent_remove_property(vtodo, prop);
671 icalproperty_free(prop);
674 lprintf(9, "New sequence is %d. Adding...\n", sequence);
675 icalcomponent_add_property(vtodo,
676 icalproperty_new_sequence(sequence)
680 * Encapsulate event into full VCALENDAR component. Clone it first,
681 * for two reasons: one, it's easier to just free the whole thing
682 * when we're done instead of unbundling, but more importantly, we
683 * can't encapsulate something that may already be encapsulated
686 lprintf(9, "Encapsulating into full VCALENDAR component\n");
687 encaps = ical_encapsulate_subcomponent(icalcomponent_new_clone(vtodo));
689 /* Serialize it and save it to the message base */
690 serv_puts("ENT0 1|||4");
691 serv_getln(buf, sizeof buf);
693 serv_puts("Content-type: text/calendar");
695 serv_puts(icalcomponent_as_ical_string(encaps));
698 /* Probably not necessary; the server will see the UID
699 * of the object and delete the old one anyway, but
704 icalcomponent_free(encaps);
708 * If the user clicked 'Delete' then explicitly delete the message.
710 if (!strcasecmp(bstr("sc"), "Delete")) {
714 if ( (delete_existing) && (msgnum > 0L) ) {
715 serv_printf("DELE %ld", atol(bstr("msgnum")));
716 serv_getln(buf, sizeof buf);
719 if (created_new_vtodo) {
720 icalcomponent_free(vtodo);
723 /* Go back to the task list */
730 * Code common to all display handlers. Given a message number and a MIME
731 * type, we load the message and hunt for that MIME type. If found, we load
732 * the relevant part, deserialize it into a libical component, filter it for
733 * the requested object type, and feed it to the specified handler.
736 void display_using_handler(long msgnum,
738 icalcomponent_kind which_kind,
739 void (*callback)(icalcomponent *, long)
742 char mime_partnum[SIZ];
743 char mime_filename[SIZ];
744 char mime_content_type[SIZ];
745 char mime_disposition[SIZ];
747 char relevant_partnum[SIZ];
748 char *relevant_source = NULL;
749 icalcomponent *cal, *c;
751 sprintf(buf, "MSG0 %ld|1", msgnum); /* ask for headers only */
753 serv_getln(buf, sizeof buf);
754 if (buf[0] != '1') return;
756 while (serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
757 if (!strncasecmp(buf, "part=", 5)) {
758 extract_token(mime_filename, &buf[5], 1, '|', sizeof mime_filename);
759 extract_token(mime_partnum, &buf[5], 2, '|', sizeof mime_partnum);
760 extract_token(mime_disposition, &buf[5], 3, '|', sizeof mime_disposition);
761 extract_token(mime_content_type, &buf[5], 4, '|', sizeof mime_content_type);
762 mime_length = extract_int(&buf[5], 5);
764 if (!strcasecmp(mime_content_type, "text/calendar")) {
765 strcpy(relevant_partnum, mime_partnum);
771 if (strlen(relevant_partnum) > 0) {
772 relevant_source = load_mimepart(msgnum, relevant_partnum);
773 if (relevant_source != NULL) {
775 cal = icalcomponent_new_from_string(relevant_source);
780 /* Simple components of desired type */
781 if (icalcomponent_isa(cal) == which_kind) {
782 callback(cal, msgnum);
785 /* Subcomponents of desired type */
786 for (c = icalcomponent_get_first_component(cal,
789 c = icalcomponent_get_next_component(cal,
793 icalcomponent_free(cal);
795 free(relevant_source);
801 void display_calendar(long msgnum) {
802 display_using_handler(msgnum, "text/calendar",
803 ICAL_VEVENT_COMPONENT,
804 display_individual_cal);
807 void display_task(long msgnum) {
808 display_using_handler(msgnum, "text/calendar",
809 ICAL_VTODO_COMPONENT,
810 display_individual_cal);
813 void display_edit_task(void) {
816 /* Force change the room if we have to */
817 if (strlen(bstr("taskrm")) > 0) {
818 gotoroom(bstr("taskrm"));
821 msgnum = atol(bstr("msgnum"));
824 display_using_handler(msgnum, "text/calendar",
825 ICAL_VTODO_COMPONENT,
826 display_edit_individual_task);
830 display_edit_individual_task(NULL, 0L);
834 void save_task(void) {
837 msgnum = atol(bstr("msgnum"));
839 display_using_handler(msgnum, "text/calendar",
840 ICAL_VTODO_COMPONENT,
841 save_individual_task);
844 save_individual_task(NULL, 0L);
848 void display_edit_event(void) {
851 msgnum = atol(bstr("msgnum"));
854 display_using_handler(msgnum, "text/calendar",
855 ICAL_VEVENT_COMPONENT,
856 display_edit_individual_event);
860 display_edit_individual_event(NULL, 0L);
864 void save_event(void) {
867 msgnum = atol(bstr("msgnum"));
870 display_using_handler(msgnum, "text/calendar",
871 ICAL_VEVENT_COMPONENT,
872 save_individual_event);
875 save_individual_event(NULL, 0L);
884 * freebusy display (for client software)
886 void do_freebusy(char *req) {
891 extract_token(who, req, 1, ' ', sizeof who);
892 if (!strncasecmp(who, "/freebusy/", 10)) {
893 strcpy(who, &who[10]);
897 if ( (!strcasecmp(&who[strlen(who)-4], ".vcf"))
898 || (!strcasecmp(&who[strlen(who)-4], ".ifb"))
899 || (!strcasecmp(&who[strlen(who)-4], ".vfb")) ) {
900 who[strlen(who)-4] = 0;
903 lprintf(9, "freebusy requested for <%s>\n", who);
904 serv_printf("ICAL freebusy|%s", who);
905 serv_getln(buf, sizeof buf);
908 wprintf("HTTP/1.0 404 %s\n", &buf[4]);
909 output_headers(0, 0, 0, 0, 0, 0, 0);
910 wprintf("Content-Type: text/plain\r\n");
912 wprintf("%s\n", &buf[4]);
916 fb = read_server_text();
917 http_transmit_thing(fb, strlen(fb), "text/calendar", 0);
923 #endif /* WEBCIT_WITH_CALENDAR_SERVICE */