Experimenting with the code layout for calendar report handling.
[citadel.git] / citadel / server / modules / calendar / calendar_report.c
1 // This is a handler for calendar "report" operations.
2 // It is expected that CALDAV REPORT operations should be able to use this directly.
3 //
4 // Copyright (c) 1987-2024 by the citadel.org team
5 //
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.
8
9 #define PRODID "-//Citadel//NONSGML Citadel Calendar//EN"
10
11 #include "../../ctdl_module.h"
12 #include <libical/ical.h>
13 #include "../../msgbase.h"
14 #include "../../internet_addressing.h"
15 #include "serv_calendar.h"
16 #include "../../room_ops.h"
17 #include "../../euidindex.h"
18 #include "../../default_timezone.h"
19 #include "../../config.h"
20
21
22 void calendar_report(void) {
23         char buf[SIZ];
24
25         // Only allow this operation if we're in a room containing a calendar or tasks view
26         if (    (CC->room.QRdefaultview != VIEW_CALENDAR)
27                 && (CC->room.QRdefaultview != VIEW_TASKS)
28         ) {
29                 cprintf("%d Not a calendar room\n", ERROR+NOT_HERE);
30                 return;         // This room does not contain a calendar.
31         }
32
33         cprintf("%d Send query then receive response\n", SEND_THEN_RECV);
34         while(client_getln(buf, sizeof buf) >= 0 && strcmp(buf,"000")) {
35         }
36         cprintf("000\n");
37 }
38
39