]> code.citadel.org Git - citadel.git/blobdiff - webcit/summary.c
* split tasks view into its own file
[citadel.git] / webcit / summary.c
index 19caa74fa1f9b9406391c1ad07848946af87246c..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>");
@@ -156,15 +168,16 @@ void calendar_section(void) {
  */
 void server_info_section(void) {
        char message[512];
+       wcsession *WCC = WC;
 
        snprintf(message, sizeof message,
                _("You are connected to %s, running %s with %s, server build %s and located in %s.  Your system administrator is %s."),
-                ChrPtr(serv_info.serv_humannode),
-                ChrPtr(serv_info.serv_software),
+                ChrPtr(WCC->serv_info->serv_humannode),
+                ChrPtr(WCC->serv_info->serv_software),
                 PACKAGE_STRING,
-                ChrPtr(serv_info.serv_svn_revision),
-                ChrPtr(serv_info.serv_bbs_city),
-                ChrPtr(serv_info.serv_sysadm));
+                ChrPtr(WCC->serv_info->serv_svn_revision),
+                ChrPtr(WCC->serv_info->serv_bbs_city),
+                ChrPtr(WCC->serv_info->serv_sysadm));
        escputs(message);
 }