X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit-ng%2Fserver%2Fcalendar_functions.c;h=d127b63de7d0e0f73b9097700f3dd3996c07fe36;hb=fb66defc37a3985fdec47c996e8108e070b94ccf;hp=fe179cb008cc86daa3953026a7118fd58a2af9b0;hpb=0e0d140960c9f47411c15c820cba700d7688d0b2;p=citadel.git diff --git a/webcit-ng/server/calendar_functions.c b/webcit-ng/server/calendar_functions.c index fe179cb00..d127b63de 100644 --- 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) { + char buf[SIZ]; // 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; } + // 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)); @@ -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 + 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);