projects
/
citadel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0e0d140
)
Starting to bring over calendar server code from webcit-classic.
author
Art Cancro
<ajc@citadel.org>
Wed, 27 Dec 2023 23:45:03 +0000
(18:45 -0500)
committer
Art Cancro
<ajc@citadel.org>
Wed, 27 Dec 2023 23:45:03 +0000
(18:45 -0500)
webcit-ng/Makefile
patch
|
blob
|
history
webcit-ng/server/caldav_reports.c
patch
|
blob
|
history
webcit-ng/server/calendar_functions.c
patch
|
blob
|
history
webcit-ng/server/webcit.h
patch
|
blob
|
history
webcit/calendar.c
patch
|
blob
|
history
diff --git
a/webcit-ng/Makefile
b/webcit-ng/Makefile
index c29a595c8522bd927f2384687bd7cf251f100274..291a9a888ccd43db01693337241b92cc72bb2266 100644
(file)
--- a/
webcit-ng/Makefile
+++ b/
webcit-ng/Makefile
@@
-14,7
+14,7
@@
SOURCES := $(wildcard $(SRC)/*.c)
OBJECTS := $(patsubst $(SRC)/%.c, $(OBJ)/%.o, $(SOURCES))
webcit: $(OBJECTS)
OBJECTS := $(patsubst $(SRC)/%.c, $(OBJ)/%.o, $(SOURCES))
webcit: $(OBJECTS)
- gcc $(CFLAGS) $(OBJECTS) $(LDFLAGS) -lcitadel -lpthread -lcrypto -lssl -lexpat -o webcit
+ gcc $(CFLAGS) $(OBJECTS) $(LDFLAGS) -lcitadel -lpthread -lcrypto -lssl -lexpat -
lical -
o webcit
$(SRC)/%.c: $(HEADERS)
touch $@
$(SRC)/%.c: $(HEADERS)
touch $@
diff --git
a/webcit-ng/server/caldav_reports.c
b/webcit-ng/server/caldav_reports.c
index d30894968e68343c63e76dcefc7277569abcea52..7fe12ff3ae2b38c0a6245f5d45fe4023da6fc8da 100644
(file)
--- a/
webcit-ng/server/caldav_reports.c
+++ b/
webcit-ng/server/caldav_reports.c
@@
-101,7
+101,7
@@
void caldav_xml_chardata(void *data, const XML_Char * s, int len) {
//
// NOTE: this function expects that "MSGP text/calendar" was issued at the beginning
// of a REPORT operation to set our preferred MIME type to calendar data.
//
// NOTE: this function expects that "MSGP text/calendar" was issued at the beginning
// of a REPORT operation to set our preferred MIME type to calendar data.
-StrBuf *fetch_ical(struct ctdlsession *
c, long msgnum) {
+StrBuf *fetch_ical(struct ctdlsession *c, long msgnum) {
char buf[1024];
StrBuf *Buf = NULL;
char buf[1024];
StrBuf *Buf = NULL;
diff --git
a/webcit-ng/server/calendar_functions.c
b/webcit-ng/server/calendar_functions.c
index fe179cb008cc86daa3953026a7118fd58a2af9b0..d127b63de7d0e0f73b9097700f3dd3996c07fe36 100644
(file)
--- a/
webcit-ng/server/calendar_functions.c
+++ b/
webcit-ng/server/calendar_functions.c
@@
-10,6
+10,7
@@
// Client is requesting a message list
void calendar_msglist(struct http_transaction *h, struct ctdlsession *c, char *range) {
// Client is requesting a message list
void calendar_msglist(struct http_transaction *h, struct ctdlsession *c, char *range) {
+ char buf[SIZ];
// Determine the date/time range requested by the client
time_t lo = atol(range);
// Determine the date/time range requested by the client
time_t lo = atol(range);
@@
-30,6
+31,12
@@
void calendar_msglist(struct http_transaction *h, struct ctdlsession *c, char *r
return;
}
return;
}
+ // We're going to make a lot of MSG4 calls, and the preferred MIME type we want is "text/calendar".
+ // The iCalendar standard is mature now, and we are no longer interested in text/x-vcal or application/ics.
+ ctdl_printf(c, "MSGP text/calendar");
+ ctdl_readline(c, buf, sizeof buf);
+
+ // Iterate through our message list.
for (i = 0; i < array_len(msglist); ++i) {
long m;
memcpy(&m, array_get_element_at(msglist, i), sizeof(long));
for (i = 0; i < array_len(msglist); ++i) {
long m;
memcpy(&m, array_get_element_at(msglist, i), sizeof(long));
@@
-41,6
+48,11
@@
void calendar_msglist(struct http_transaction *h, struct ctdlsession *c, char *r
// 3. figure out range
// we should steal code from webcit-classic for this
// 3. figure out range
// we should steal code from webcit-classic for this
+ StrBuf *one_item;
+ one_item = fetch_ical(c, m);
+ syslog(LOG_DEBUG, "calendar item:\n---\n\033[33m%s\n---\033[0m", ChrPtr(one_item));
+ FreeStrBuf(&one_item);
+
}
array_free(msglist);
}
array_free(msglist);
diff --git
a/webcit-ng/server/webcit.h
b/webcit-ng/server/webcit.h
index b678ceffc2007e0b33a802533ef1d11207788090..1a187fef815f03aa7e6c3d2b1aae14fb76c1b00c 100644
(file)
--- a/
webcit-ng/server/webcit.h
+++ b/
webcit-ng/server/webcit.h
@@
-34,6
+34,7
@@
#include <stdarg.h>
#include <limits.h>
#include <iconv.h>
#include <stdarg.h>
#include <limits.h>
#include <iconv.h>
+#include <libical/ical.h>
#include <libcitadel.h>
#define OPENSSL_NO_KRB5 // Work around RedHat's b0rken OpenSSL includes
#include <openssl/ssl.h>
#include <libcitadel.h>
#define OPENSSL_NO_KRB5 // Work around RedHat's b0rken OpenSSL includes
#include <openssl/ssl.h>
diff --git
a/webcit/calendar.c
b/webcit/calendar.c
index f0f34ef84e05a4344b449df7032f2cbf2a7394d2..ce49b34558729079dd231829963decab134a7db7 100644
(file)
--- a/
webcit/calendar.c
+++ b/
webcit/calendar.c
@@
-668,7
+668,7
@@
void load_ical_object(long msgnum, int unread,
|| (!strcasecmp(mime_content_type, "application/ics"))
|| (!strcasecmp(mime_content_type, "text/vtodo"))
|| (!strcasecmp(mime_content_type, "text/todo"))
|| (!strcasecmp(mime_content_type, "application/ics"))
|| (!strcasecmp(mime_content_type, "text/vtodo"))
|| (!strcasecmp(mime_content_type, "text/todo"))
-
) {
+ ) {
strcpy(relevant_partnum, mime_partnum);
}
}
strcpy(relevant_partnum, mime_partnum);
}
}