X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit-ng%2Fserver%2Fcalendar_functions.c;h=7d88996ed1e16271c6528297b1b8b794fcf948ad;hb=ebc6e316f87b5091d06055cd9c2d97cb46985557;hp=73305d7336dd4467db74bba8f48102a4cd589f25;hpb=1cf65827496ede0bed7172122acd381666211894;p=citadel.git diff --git a/webcit-ng/server/calendar_functions.c b/webcit-ng/server/calendar_functions.c index 73305d733..7d88996ed 100644 --- a/webcit-ng/server/calendar_functions.c +++ b/webcit-ng/server/calendar_functions.c @@ -11,6 +11,17 @@ // Client is requesting a message list void calendar_msglist(struct http_transaction *h, struct ctdlsession *c, char *range) { + // Determine the date/time range requested by the client + time_t lo = atol(range); + char *colon = strchr(range, ':'); + time_t hi = colon ? atol(++colon) : LONG_MAX; + + // Rule out impossible ranges + if (hi < lo) { + do_404(h); + return; + } + // Begin by requesting all messages in the room int i = 0; Array *msglist = get_msglist(c, "ALL"); @@ -23,6 +34,13 @@ void calendar_msglist(struct http_transaction *h, struct ctdlsession *c, char *r long m; memcpy(&m, array_get_element_at(msglist, i), sizeof(long)); syslog(LOG_DEBUG, "FIXME %ld", m); + + // now we have to: + // 1. fetch the message from citadel server + // 2. parse the ical + // 3. figure out range + // we should steal code from webcit-classic for this + } array_free(msglist);