]> code.citadel.org Git - citadel.git/blobdiff - webcit/summary.c
* split tasks view into its own file
[citadel.git] / webcit / summary.c
index 43c8e590dac5bffac585b0ab0115447fa5363ed3..fb34a85837a4fa08f84fd1a6c091933ceb891750 100644 (file)
@@ -5,6 +5,7 @@
  */
 
 #include "webcit.h"
+#include "calendar.h"
 
 /*
  * Display today's date in a friendly format
@@ -84,7 +85,9 @@ void tasks_section(void) {
        message_summary *Msg;
        wcsession *WCC = WC;
        StrBuf *Buf;
+       SharedMessageStatus Stat;
 
+       memset(&Stat, 0, sizeof(SharedMessageStatus));
        Buf = NewStrBufPlain(HKEY("_TASKS_"));
        gotoroom(Buf);
        FreeStrBuf(&Buf);
@@ -92,15 +95,16 @@ void tasks_section(void) {
                num_msgs = 0;
        }
        else {
-               num_msgs = load_msg_ptrs("MSGS ALL", 0);
+               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);
        }
 
        if (calendar_summary_view() < 1) {
@@ -115,6 +119,7 @@ void tasks_section(void) {
  * Calendar section
  */
 void calendar_section(void) {
+       char cmd[SIZ];
        int num_msgs = 0;
        HashPos *at;
        const char *HashKey;
@@ -122,9 +127,12 @@ void calendar_section(void) {
        void *vMsg;
        message_summary *Msg;
        wcsession *WCC = WC;
-       struct calview c;
+       calview c;
        StrBuf *Buf;
+       void *v = &c;
+       SharedMessageStatus Stat;
 
+       memset(&Stat, 0, sizeof(SharedMessageStatus));
        Buf = NewStrBufPlain(HKEY("_CALENDAR_"));
        gotoroom(Buf);
        FreeStrBuf(&Buf);
@@ -132,17 +140,21 @@ void calendar_section(void) {
                num_msgs = 0;
        }
        else {
-               num_msgs = load_msg_ptrs("MSGS ALL", 0);
+               num_msgs = load_msg_ptrs("MSGS ALL", &Stat);
        }
-
-       parse_calendar_view_request(&c);
+       calendar_GetParamsGetServerCall(&Stat, 
+                                       &c,
+                                       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);
        }
        if (calendar_summary_view() < 1) {
                wprintf("<i>");