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 $@
//
// 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;
// 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);
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));
// 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);
|| (!strcasecmp(mime_content_type, "application/ics"))
|| (!strcasecmp(mime_content_type, "text/vtodo"))
|| (!strcasecmp(mime_content_type, "text/todo"))
- ) {
+ ) {
strcpy(relevant_partnum, mime_partnum);
}
}