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[SIZ];
71 /* Leading HTML for the display of this object */
72 if (recursion_level == 0) {
73 wprintf("<CENTER><TABLE border=0>\n");
76 /* Look for a method */
77 method = icalcomponent_get_first_property(cal, ICAL_METHOD_PROPERTY);
79 /* See what we need to do with this */
81 the_method = icalproperty_get_method(method);
83 case ICAL_METHOD_REQUEST:
84 wprintf("<tr><td colspan=\"2\">\n"
85 "<img align=\"center\" "
86 "src=\"/static/calarea_48x.gif\">"
89 wprintf(_("Meeting invitation"));
90 wprintf("</B></TD></TR>\n");
92 case ICAL_METHOD_REPLY:
93 wprintf("<TR><TD COLSPAN=2>\n"
95 "SRC=\"/static/calarea_48x.gif\">"
98 wprintf(_("Attendee's reply to your invitation"));
99 wprintf("</B></TD></TR>\n");
101 case ICAL_METHOD_PUBLISH:
102 wprintf("<TR><TD COLSPAN=2>\n"
104 "SRC=\"/static/calarea_48x.gif\">"
107 wprintf(_("Published event"));
108 wprintf("</B></TD></TR>\n");
111 wprintf("<TR><TD COLSPAN=2>");
112 wprintf(_("This is an unknown type of calendar item."));
113 wprintf("</TD></TR>\n");
118 p = icalcomponent_get_first_property(cal, ICAL_SUMMARY_PROPERTY);
120 wprintf("<TR><TD><B>");
121 wprintf(_("Summary:"));
122 wprintf("</B></TD><TD>");
123 escputs((char *)icalproperty_get_comment(p));
124 wprintf("</TD></TR>\n");
127 p = icalcomponent_get_first_property(cal, ICAL_LOCATION_PROPERTY);
129 wprintf("<TR><TD><B>");
130 wprintf(_("Location:"));
131 wprintf("</B></TD><TD>");
132 escputs((char *)icalproperty_get_comment(p));
133 wprintf("</TD></TR>\n");
137 * Only show start/end times if we're actually looking at the VEVENT
138 * component. Otherwise it shows bogus dates for things like timezone.
140 if (icalcomponent_isa(cal) == ICAL_VEVENT_COMPONENT) {
142 p = icalcomponent_get_first_property(cal,
143 ICAL_DTSTART_PROPERTY);
145 t = icalproperty_get_dtstart(p);
148 wprintf("<TR><TD><B>");
150 wprintf("</B></TD><TD>"
151 "%s %d, %d</TD></TR>",
157 tt = icaltime_as_timet(t);
158 fmt_date(buf, tt, 0);
159 wprintf("<TR><TD><B>");
160 wprintf(_("Starting date/time:"));
161 wprintf("</B></TD><TD>%s</TD></TR>", buf);
165 p = icalcomponent_get_first_property(cal, ICAL_DTEND_PROPERTY);
167 t = icalproperty_get_dtend(p);
168 tt = icaltime_as_timet(t);
169 fmt_date(buf, tt, 0);
170 wprintf("<TR><TD><B>");
171 wprintf(_("Ending date/time:"));
172 wprintf("</B></TD><TD>%s</TD></TR>", buf);
177 p = icalcomponent_get_first_property(cal, ICAL_DESCRIPTION_PROPERTY);
179 wprintf("<TR><TD><B>");
180 wprintf(_("Description:"));
181 wprintf("</B></TD><TD>");
182 escputs((char *)icalproperty_get_comment(p));
183 wprintf("</TD></TR>\n");
186 /* If the component has attendees, iterate through them. */
187 for (p = icalcomponent_get_first_property(cal, ICAL_ATTENDEE_PROPERTY); (p != NULL); p = icalcomponent_get_next_property(cal, ICAL_ATTENDEE_PROPERTY)) {
188 wprintf("<TR><TD><B>");
189 wprintf(_("Attendee:"));
190 wprintf("</B></TD><TD>");
191 strcpy(buf, icalproperty_get_attendee(p));
192 if (!strncasecmp(buf, "MAILTO:", 7)) {
194 /* screen name or email address */
195 strcpy(buf, &buf[7]);
200 /* participant status */
201 partstat_as_string(buf, p);
204 wprintf("</TD></TR>\n");
207 /* If the component has subcomponents, recurse through them. */
208 for (c = icalcomponent_get_first_component(cal, ICAL_ANY_COMPONENT);
210 c = icalcomponent_get_next_component(cal, ICAL_ANY_COMPONENT)) {
211 /* Recursively process subcomponent */
212 cal_process_object(c, recursion_level+1, msgnum, cal_partnum);
215 /* If this is a REQUEST, display conflicts and buttons */
216 if (the_method == ICAL_METHOD_REQUEST) {
218 /* Check for conflicts */
219 lprintf(9, "Checking server calendar for conflicts...\n");
220 serv_printf("ICAL conflicts|%ld|%s|", msgnum, cal_partnum);
221 serv_getln(buf, sizeof buf);
223 while (serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
224 extract_token(conflict_name, buf, 3, '|', sizeof conflict_name);
225 is_update = extract_int(buf, 4);
226 wprintf("<TR><TD><B><I>%s</I></B></TD>"
237 "This is an update of" :
238 "This event would conflict with"
242 escputs(conflict_name);
243 wprintf(""</I> "
244 "which is already in your calendar."
248 lprintf(9, "...done.\n");
250 /* Display the Accept/Decline buttons */
251 wprintf("<TR><TD>How would you like to respond to this invitation?</td>"
253 "<A HREF=\"/respond_to_request?msgnum=%ld&cal_partnum=%s&sc=Accept\">Accept</a>"
255 "<A HREF=\"/respond_to_request?msgnum=%ld&cal_partnum=%s&sc=Tentative\">Tentative</a>"
257 "<A HREF=\"/respond_to_request?msgnum=%ld&cal_partnum=%s&sc=Decline\">Decline</a>"
258 "</FONT></TD></TR>\n",
266 /* If this is a REPLY, display update button */
267 if (the_method == ICAL_METHOD_REPLY) {
270 * In the future, if we want to validate this object before
271 * continuing, we can do it this way:
272 serv_printf("ICAL whatever|%ld|%s|", msgnum, cal_partnum);
273 serv_getln(buf, sizeof buf);
277 /* Display the update buttons */
279 "Click <i>Update</i> to accept this reply and "
280 "update your calendar."
281 "</td><td><font size=+1>"
282 "<a href=\"/handle_rsvp?msgnum=%ld&cal_partnum=%s&sc=Update\">Update</a>"
284 "<a href=\"/handle_rsvp?msgnum=%ld&cal_partnum=%s&sc=Ignore\">Ignore</a>"
293 /* Trailing HTML for the display of this object */
294 if (recursion_level == 0) {
296 wprintf("</TR></TABLE></CENTER>\n");
302 * Deserialize a calendar object in a message so it can be processed.
303 * (This is the main entry point for these things)
305 void cal_process_attachment(char *part_source, long msgnum, char *cal_partnum) {
308 cal = icalcomponent_new_from_string(part_source);
311 wprintf("Error parsing calendar object<br />\n");
316 cal_process_object(cal, 0, msgnum, cal_partnum);
318 /* Free the memory we obtained from libical's constructor */
319 icalcomponent_free(cal);
326 * Respond to a meeting request
328 void respond_to_request(void) {
331 output_headers(1, 1, 2, 0, 0, 0, 0);
333 wprintf("<div id=\"banner\">\n");
334 wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR><TD>"
335 "<SPAN CLASS=\"titlebar\">Respond to meeting request</SPAN>"
336 "</TD></TR></TABLE>\n"
338 wprintf("</div>\n<div id=\"content\">\n");
340 serv_printf("ICAL respond|%s|%s|%s|",
345 serv_getln(buf, sizeof buf);
348 wprintf("<TABLE BORDER=0><TR><TD>"
349 "<IMG SRC=\"static/calarea_48x.gif\" ALIGN=CENTER>"
352 if (!strcasecmp(bstr("sc"), "accept")) {
353 wprintf("You have accepted this meeting invitation. "
354 "It has been entered into your calendar, "
356 } else if (!strcasecmp(bstr("sc"), "tentative")) {
357 wprintf("You have tentatively accepted this meeting invitation. "
358 "It has been 'pencilled in' to your calendar, "
360 } else if (!strcasecmp(bstr("sc"), "decline")) {
361 wprintf("You have declined this meeting invitation. "
362 "It has <b>not</b> been entered into your calendar, "
365 wprintf("and a reply has been sent to the meeting organizer."
366 "</TD></TR></TABLE>\n"
369 wprintf("<IMG SRC=\"static/error.gif\" ALIGN=CENTER>"
373 wprintf("<A HREF=\"/dotskip?room=");
374 urlescputs(WC->wc_roomname);
375 wprintf("\"><br />Return to messages</A><br />\n");
383 * Handle an incoming RSVP
385 void handle_rsvp(void) {
388 output_headers(1, 1, 2, 0, 0, 0, 0);
390 wprintf("<div id=\"banner\">\n");
391 wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR><TD>"
392 "<SPAN CLASS=\"titlebar\">"
393 "Update your calendar with this RSVP</SPAN>"
394 "</TD></TR></TABLE>\n"
395 "</div>\n<div id=\"content\">\n"
398 serv_printf("ICAL handle_rsvp|%s|%s|%s|",
403 serv_getln(buf, sizeof buf);
406 wprintf("<TABLE BORDER=0><TR><TD>"
407 "<IMG SRC=\"static/calarea_48x.gif\" ALIGN=CENTER>"
410 if (!strcasecmp(bstr("sc"), "update")) {
411 wprintf("Your calendar has been updated "
412 "to reflect this RSVP."
414 } else if (!strcasecmp(bstr("sc"), "ignore")) {
415 wprintf("You have chosen to ignore this RSVP. "
416 "Your calendar has <b>not</b> been updated."
419 wprintf("</TD></TR></TABLE>\n"
422 wprintf("<IMG SRC=\"static/error.gif\" ALIGN=CENTER>"
426 wprintf("<A HREF=\"/dotskip?room=");
427 urlescputs(WC->wc_roomname);
428 wprintf("\"><br />Return to messages</A><br />\n");
436 /*****************************************************************************/
441 * Display handlers for message reading
447 * If we're reading calendar items, just store them for now. We have to
448 * sort and re-output them later when we draw the calendar.
450 void display_individual_cal(icalcomponent *cal, long msgnum) {
454 WC->disp_cal = realloc(WC->disp_cal,
455 (sizeof(struct disp_cal) * WC->num_cal) );
456 WC->disp_cal[WC->num_cal - 1].cal = icalcomponent_new_clone(cal);
458 WC->disp_cal[WC->num_cal - 1].cal_msgnum = msgnum;
464 * Display a task by itself (for editing)
467 void display_edit_individual_task(icalcomponent *supplied_vtodo, long msgnum) {
468 icalcomponent *vtodo;
470 struct icaltimetype t;
472 int created_new_vtodo = 0;
476 if (supplied_vtodo != NULL) {
477 vtodo = supplied_vtodo;
479 /* If we're looking at a fully encapsulated VCALENDAR
480 * rather than a VTODO component, attempt to use the first
481 * relevant VTODO subcomponent. If there is none, the
482 * NULL returned by icalcomponent_get_first_component() will
483 * tell the next iteration of this function to create a
486 if (icalcomponent_isa(vtodo) == ICAL_VCALENDAR_COMPONENT) {
487 display_edit_individual_task(
488 icalcomponent_get_first_component(
489 vtodo, ICAL_VTODO_COMPONENT
496 vtodo = icalcomponent_new(ICAL_VTODO_COMPONENT);
497 created_new_vtodo = 1;
500 output_headers(1, 1, 2, 0, 0, 0, 0);
501 wprintf("<div id=\"banner\">\n"
502 "<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR>"
503 "<TD><IMG SRC=\"/static/taskmanag_48x.gif\"></TD>"
504 "<td><SPAN CLASS=\"titlebar\">Edit task</SPAN>"
505 "</TD></TR></TABLE>\n"
506 "</div>\n<div id=\"content\">\n"
509 wprintf("<div id=\"fix_scrollbar_bug\">"
510 "<table border=0 width=100%% bgcolor=\"#ffffff\"><tr><td>");
512 wprintf("<FORM METHOD=\"POST\" ACTION=\"/save_task\">\n");
513 wprintf("<INPUT TYPE=\"hidden\" NAME=\"msgnum\" VALUE=\"%ld\">\n",
516 wprintf("<TABLE border=0>\n");
518 wprintf("<TR><TD>Summary:</TD><TD>"
519 "<INPUT TYPE=\"text\" NAME=\"summary\" "
520 "MAXLENGTH=\"64\" SIZE=\"64\" VALUE=\"");
521 p = icalcomponent_get_first_property(vtodo, ICAL_SUMMARY_PROPERTY);
523 escputs((char *)icalproperty_get_comment(p));
525 wprintf("\"></TD></TR>\n");
527 wprintf("<TR><TD>Start date:</TD><TD>");
528 p = icalcomponent_get_first_property(vtodo, ICAL_DTSTART_PROPERTY);
530 t = icalproperty_get_dtstart(p);
533 t = icaltime_from_timet(now, 0);
535 display_icaltimetype_as_webform(&t, "dtstart");
536 wprintf("</TD></TR>\n");
538 wprintf("<TR><TD>Due date:</TD><TD>");
539 p = icalcomponent_get_first_property(vtodo, ICAL_DUE_PROPERTY);
541 t = icalproperty_get_due(p);
544 t = icaltime_from_timet(now, 0);
546 display_icaltimetype_as_webform(&t, "due");
547 wprintf("</TD></TR>\n");
548 wprintf("<TR><TD>Description:</TD><TD>");
549 wprintf("<TEXTAREA NAME=\"description\" wrap=soft "
550 "ROWS=10 COLS=80 WIDTH=80>\n"
552 p = icalcomponent_get_first_property(vtodo, ICAL_DESCRIPTION_PROPERTY);
554 escputs((char *)icalproperty_get_comment(p));
556 wprintf("</TEXTAREA></TD></TR></TABLE>\n");
559 "<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Save\">"
561 "<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Delete\">\n"
563 "<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">\n"
567 wprintf("</FORM>\n");
569 wprintf("</td></tr></table></div>\n");
572 if (created_new_vtodo) {
573 icalcomponent_free(vtodo);
578 * Save an edited task
581 void save_individual_task(icalcomponent *supplied_vtodo, long msgnum) {
583 int delete_existing = 0;
585 icalcomponent *vtodo, *encaps;
586 int created_new_vtodo = 0;
589 struct icaltimetype t;
591 if (supplied_vtodo != NULL) {
592 vtodo = supplied_vtodo;
593 /* If we're looking at a fully encapsulated VCALENDAR
594 * rather than a VTODO component, attempt to use the first
595 * relevant VTODO subcomponent. If there is none, the
596 * NULL returned by icalcomponent_get_first_component() will
597 * tell the next iteration of this function to create a
600 if (icalcomponent_isa(vtodo) == ICAL_VCALENDAR_COMPONENT) {
601 save_individual_task(
602 icalcomponent_get_first_component(
603 vtodo, ICAL_VTODO_COMPONENT
610 vtodo = icalcomponent_new(ICAL_VTODO_COMPONENT);
611 created_new_vtodo = 1;
614 if (!strcasecmp(bstr("sc"), "Save")) {
616 /* Replace values in the component with ones from the form */
618 while (prop = icalcomponent_get_first_property(vtodo,
619 ICAL_SUMMARY_PROPERTY), prop != NULL) {
620 icalcomponent_remove_property(vtodo, prop);
621 icalproperty_free(prop);
623 icalcomponent_add_property(vtodo,
624 icalproperty_new_summary(bstr("summary")));
626 while (prop = icalcomponent_get_first_property(vtodo,
627 ICAL_DESCRIPTION_PROPERTY), prop != NULL) {
628 icalcomponent_remove_property(vtodo, prop);
629 icalproperty_free(prop);
631 icalcomponent_add_property(vtodo,
632 icalproperty_new_description(bstr("description")));
634 while (prop = icalcomponent_get_first_property(vtodo,
635 ICAL_DTSTART_PROPERTY), prop != NULL) {
636 icalcomponent_remove_property(vtodo, prop);
637 icalproperty_free(prop);
639 icaltime_from_webform(&t, "dtstart");
640 icalcomponent_add_property(vtodo,
641 icalproperty_new_dtstart(t)
644 while (prop = icalcomponent_get_first_property(vtodo,
645 ICAL_DUE_PROPERTY), prop != NULL) {
646 icalcomponent_remove_property(vtodo, prop);
647 icalproperty_free(prop);
649 icaltime_from_webform(&t, "due");
650 icalcomponent_add_property(vtodo,
651 icalproperty_new_due(t)
654 /* Give this task a UID if it doesn't have one. */
655 lprintf(9, "Give this task a UID if it doesn't have one.\n");
656 if (icalcomponent_get_first_property(vtodo,
657 ICAL_UID_PROPERTY) == NULL) {
659 icalcomponent_add_property(vtodo,
660 icalproperty_new_uid(buf)
664 /* Increment the sequence ID */
665 lprintf(9, "Increment the sequence ID\n");
666 while (prop = icalcomponent_get_first_property(vtodo,
667 ICAL_SEQUENCE_PROPERTY), (prop != NULL) ) {
668 i = icalproperty_get_sequence(prop);
669 lprintf(9, "Sequence was %d\n", i);
670 if (i > sequence) sequence = i;
671 icalcomponent_remove_property(vtodo, prop);
672 icalproperty_free(prop);
675 lprintf(9, "New sequence is %d. Adding...\n", sequence);
676 icalcomponent_add_property(vtodo,
677 icalproperty_new_sequence(sequence)
681 * Encapsulate event into full VCALENDAR component. Clone it first,
682 * for two reasons: one, it's easier to just free the whole thing
683 * when we're done instead of unbundling, but more importantly, we
684 * can't encapsulate something that may already be encapsulated
687 lprintf(9, "Encapsulating into full VCALENDAR component\n");
688 encaps = ical_encapsulate_subcomponent(icalcomponent_new_clone(vtodo));
690 /* Serialize it and save it to the message base */
691 serv_puts("ENT0 1|||4");
692 serv_getln(buf, sizeof buf);
694 serv_puts("Content-type: text/calendar");
696 serv_puts(icalcomponent_as_ical_string(encaps));
699 /* Probably not necessary; the server will see the UID
700 * of the object and delete the old one anyway, but
705 icalcomponent_free(encaps);
709 * If the user clicked 'Delete' then explicitly delete the message.
711 if (!strcasecmp(bstr("sc"), "Delete")) {
715 if ( (delete_existing) && (msgnum > 0L) ) {
716 serv_printf("DELE %ld", atol(bstr("msgnum")));
717 serv_getln(buf, sizeof buf);
720 if (created_new_vtodo) {
721 icalcomponent_free(vtodo);
724 /* Go back to the task list */
731 * Code common to all display handlers. Given a message number and a MIME
732 * type, we load the message and hunt for that MIME type. If found, we load
733 * the relevant part, deserialize it into a libical component, filter it for
734 * the requested object type, and feed it to the specified handler.
737 void display_using_handler(long msgnum,
739 icalcomponent_kind which_kind,
740 void (*callback)(icalcomponent *, long)
743 char mime_partnum[SIZ];
744 char mime_filename[SIZ];
745 char mime_content_type[SIZ];
746 char mime_disposition[SIZ];
748 char relevant_partnum[SIZ];
749 char *relevant_source = NULL;
750 icalcomponent *cal, *c;
752 sprintf(buf, "MSG0 %ld|1", msgnum); /* ask for headers only */
754 serv_getln(buf, sizeof buf);
755 if (buf[0] != '1') return;
757 while (serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
758 if (!strncasecmp(buf, "part=", 5)) {
759 extract_token(mime_filename, &buf[5], 1, '|', sizeof mime_filename);
760 extract_token(mime_partnum, &buf[5], 2, '|', sizeof mime_partnum);
761 extract_token(mime_disposition, &buf[5], 3, '|', sizeof mime_disposition);
762 extract_token(mime_content_type, &buf[5], 4, '|', sizeof mime_content_type);
763 mime_length = extract_int(&buf[5], 5);
765 if (!strcasecmp(mime_content_type, "text/calendar")) {
766 strcpy(relevant_partnum, mime_partnum);
772 if (strlen(relevant_partnum) > 0) {
773 relevant_source = load_mimepart(msgnum, relevant_partnum);
774 if (relevant_source != NULL) {
776 cal = icalcomponent_new_from_string(relevant_source);
781 /* Simple components of desired type */
782 if (icalcomponent_isa(cal) == which_kind) {
783 callback(cal, msgnum);
786 /* Subcomponents of desired type */
787 for (c = icalcomponent_get_first_component(cal,
790 c = icalcomponent_get_next_component(cal,
794 icalcomponent_free(cal);
796 free(relevant_source);
802 void display_calendar(long msgnum) {
803 display_using_handler(msgnum, "text/calendar",
804 ICAL_VEVENT_COMPONENT,
805 display_individual_cal);
808 void display_task(long msgnum) {
809 display_using_handler(msgnum, "text/calendar",
810 ICAL_VTODO_COMPONENT,
811 display_individual_cal);
814 void display_edit_task(void) {
817 /* Force change the room if we have to */
818 if (strlen(bstr("taskrm")) > 0) {
819 gotoroom(bstr("taskrm"));
822 msgnum = atol(bstr("msgnum"));
825 display_using_handler(msgnum, "text/calendar",
826 ICAL_VTODO_COMPONENT,
827 display_edit_individual_task);
831 display_edit_individual_task(NULL, 0L);
835 void save_task(void) {
838 msgnum = atol(bstr("msgnum"));
840 display_using_handler(msgnum, "text/calendar",
841 ICAL_VTODO_COMPONENT,
842 save_individual_task);
845 save_individual_task(NULL, 0L);
849 void display_edit_event(void) {
852 msgnum = atol(bstr("msgnum"));
855 display_using_handler(msgnum, "text/calendar",
856 ICAL_VEVENT_COMPONENT,
857 display_edit_individual_event);
861 display_edit_individual_event(NULL, 0L);
865 void save_event(void) {
868 msgnum = atol(bstr("msgnum"));
871 display_using_handler(msgnum, "text/calendar",
872 ICAL_VEVENT_COMPONENT,
873 save_individual_event);
876 save_individual_event(NULL, 0L);
885 * freebusy display (for client software)
887 void do_freebusy(char *req) {
892 extract_token(who, req, 1, ' ', sizeof who);
893 if (!strncasecmp(who, "/freebusy/", 10)) {
894 strcpy(who, &who[10]);
898 if ( (!strcasecmp(&who[strlen(who)-4], ".vcf"))
899 || (!strcasecmp(&who[strlen(who)-4], ".ifb"))
900 || (!strcasecmp(&who[strlen(who)-4], ".vfb")) ) {
901 who[strlen(who)-4] = 0;
904 lprintf(9, "freebusy requested for <%s>\n", who);
905 serv_printf("ICAL freebusy|%s", who);
906 serv_getln(buf, sizeof buf);
909 wprintf("HTTP/1.0 404 %s\n", &buf[4]);
910 output_headers(0, 0, 0, 0, 0, 0, 0);
911 wprintf("Content-Type: text/plain\r\n");
913 wprintf("%s\n", &buf[4]);
917 fb = read_server_text();
918 http_transmit_thing(fb, strlen(fb), "text/calendar", 0);
924 #endif /* WEBCIT_WITH_CALENDAR_SERVICE */