]> code.citadel.org Git - citadel.git/blobdiff - webcit/summary.c
* add a Display name to our handlers; this will be used by DAV handlers.
[citadel.git] / webcit / summary.c
index ae2588da2651a541f7dd5523afe3757bc4c2a874..a5db298b030bf8cbec17e3f0b9cf31e9c54257b5 100644 (file)
@@ -5,6 +5,7 @@
  */
 
 #include "webcit.h"
+#include "calendar.h"
 
 /*
  * Display today's date in a friendly format
@@ -84,6 +85,12 @@ void tasks_section(void) {
        message_summary *Msg;
        wcsession *WCC = WC;
        StrBuf *Buf;
+       SharedMessageStatus Stat;
+
+       memset(&Stat, 0, sizeof(SharedMessageStatus));
+       Stat.maxload = 10000;
+       Stat.lowest_found = (-1);
+       Stat.highest_found = (-1);
 
        Buf = NewStrBufPlain(HKEY("_TASKS_"));
        gotoroom(Buf);
@@ -92,14 +99,14 @@ void tasks_section(void) {
                num_msgs = 0;
        }
        else {
-               num_msgs = load_msg_ptrs("MSGS ALL", 0, NULL, NULL);
+               num_msgs = load_msg_ptrs("MSGS ALL", &Stat);
        }
 
        if (num_msgs > 0) {
                at = GetNewHashPos(WCC->summ, 0);
                while (GetNextHashPos(WCC->summ, at, &HKLen, &HashKey, &vMsg)) {
                        Msg = (message_summary*) vMsg;          
-                       display_task(Msg, 0);
+                       tasks_LoadMsgFromServer(NULL, NULL, Msg, 0, 0);
                }
                DeleteHashPos(&at);
        }
@@ -116,6 +123,7 @@ void tasks_section(void) {
  * Calendar section
  */
 void calendar_section(void) {
+       char cmd[SIZ];
        int num_msgs = 0;
        HashPos *at;
        const char *HashKey;
@@ -123,9 +131,15 @@ void calendar_section(void) {
        void *vMsg;
        message_summary *Msg;
        wcsession *WCC = WC;
-       struct calview c;
        StrBuf *Buf;
-
+       void *v = NULL;
+       SharedMessageStatus Stat;
+
+       memset(&Stat, 0, sizeof(SharedMessageStatus));
+       Stat.maxload = 10000;
+       Stat.lowest_found = (-1);
+       Stat.highest_found = (-1);
+       
        Buf = NewStrBufPlain(HKEY("_CALENDAR_"));
        gotoroom(Buf);
        FreeStrBuf(&Buf);
@@ -133,16 +147,19 @@ void calendar_section(void) {
                num_msgs = 0;
        }
        else {
-               num_msgs = load_msg_ptrs("MSGS ALL", 0, NULL, NULL);
+               num_msgs = load_msg_ptrs("MSGS ALL", &Stat);
        }
-
-       parse_calendar_view_request(&c);
+       calendar_GetParamsGetServerCall(&Stat, 
+                                       &v,
+                                       readnew, 
+                                       cmd, 
+                                       sizeof(cmd));
 
        if (num_msgs > 0) {
                at = GetNewHashPos(WCC->summ, 0);
                while (GetNextHashPos(WCC->summ, at, &HKLen, &HashKey, &vMsg)) {
                        Msg = (message_summary*) vMsg;          
-                       load_calendar_item(Msg, 0, &c);
+                       calendar_LoadMsgFromServer(NULL, &v, Msg, 0, 0);
                }
                DeleteHashPos(&at);
        }
@@ -151,6 +168,7 @@ void calendar_section(void) {
                wprintf(_("(Nothing)"));
                wprintf("</i><br />\n");
        }
+       __calendar_Cleanup(&v);
 }
 
 /*
@@ -311,11 +329,11 @@ void
 InitModule_SUMMARY
 (void)
 {
-       WebcitAddUrlHandler(HKEY("new_messages_html"), new_messages_section, AJAX);
-       WebcitAddUrlHandler(HKEY("tasks_inner_html"), tasks_section, AJAX);
-       WebcitAddUrlHandler(HKEY("calendar_inner_html"), calendar_section, AJAX);
-       WebcitAddUrlHandler(HKEY("mini_calendar"), ajax_mini_calendar, AJAX);
-       WebcitAddUrlHandler(HKEY("summary"), summary, 0);
-       WebcitAddUrlHandler(HKEY("summary_inner_div"), summary_inner_div, AJAX);
+       WebcitAddUrlHandler(HKEY("new_messages_html"), "", 0, new_messages_section, AJAX);
+       WebcitAddUrlHandler(HKEY("tasks_inner_html"), "", 0, tasks_section, AJAX);
+       WebcitAddUrlHandler(HKEY("calendar_inner_html"), "", 0, calendar_section, AJAX);
+       WebcitAddUrlHandler(HKEY("mini_calendar"), "", 0, ajax_mini_calendar, AJAX);
+       WebcitAddUrlHandler(HKEY("summary"), "", 0, summary, 0);
+       WebcitAddUrlHandler(HKEY("summary_inner_div"), "", 0, summary_inner_div, AJAX);
 }