1 // This is a handler for calendar "report" operations.
2 // It is expected that CALDAV REPORT operations should be able to use this directly.
4 // Copyright (c) 1987-2024 by the citadel.org team
6 // This program is open source software. Use, duplication, or disclosure
7 // are subject to the terms of the GNU General Public License version 3.
9 #include <libical/ical.h>
10 #include "../../ctdl_module.h"
11 #include "../../msgbase.h"
12 #include "../../internet_addressing.h"
13 #include "../../room_ops.h"
14 #include "../../euidindex.h"
15 #include "../../default_timezone.h"
16 #include "../../config.h"
17 #include "serv_calendar.h"
20 // CtdlForEachMessage back end
21 void calendar_report_backend(long msgnum, void *data) {
22 syslog(LOG_DEBUG, "%ld", msgnum);
26 void calendar_report(void) {
29 // Only allow this operation if we're in a room containing a calendar or tasks view
30 if ( (CC->room.QRdefaultview != VIEW_CALENDAR)
31 && (CC->room.QRdefaultview != VIEW_TASKS)
33 cprintf("%d Not a calendar room\n", ERROR+NOT_HERE);
34 return; // This room does not contain a calendar.
38 // Now go through the room encapsulating all calendar items.
40 CtdlForEachMessage(MSGS_ALL, 0, NULL,
43 calendar_report_backend,
47 cprintf("%d Not finished\n", ERROR);
48 //cprintf("%d Send query then receive response\n", SEND_THEN_RECV);
49 //while(client_getln(buf, sizeof buf) >= 0 && strcmp(buf,"000")) {