]> code.citadel.org Git - citadel.git/blobdiff - webcit/summary.c
* follow api-change in several places
[citadel.git] / webcit / summary.c
index ffd840853bc1470c29ac33a6093d35ada8a8a3c0..41d2aa025828dfd6b2fd70b74752122c0bf4a9ce 100644 (file)
@@ -29,7 +29,7 @@ void output_date(void) {
  */
 void dummy_section(void) {
        svput("BOXTITLE", WCS_STRING, "(dummy section)");
-       do_template("beginbox", NULL);
+       do_template("beginboxx", NULL);
        wprintf(_("(nothing)"));
        do_template("endbox", NULL);
 }
@@ -77,10 +77,15 @@ void new_messages_section(void) {
  */
 void tasks_section(void) {
        int num_msgs = 0;
-       int i;
+       HashPos *at;
+       const char *HashKey;
+       long HKLen;
+       void *vMsg;
+       message_summary *Msg;
+       struct wcsession *WCC = WC;
 
        gotoroom("_TASKS_");
-       if (WC->wc_view != VIEW_TASKS) {
+       if (WCC->wc_view != VIEW_TASKS) {
                num_msgs = 0;
        }
        else {
@@ -93,8 +98,10 @@ void tasks_section(void) {
                wprintf("</i><br />\n");
        }
        else {
-               for (i=0; i<num_msgs; ++i) {
-                       display_task(WC->msgarr[i], 0);
+               at = GetNewHashPos(WCC->summ, 0);
+               while (GetNextHashPos(WCC->summ, at, &HKLen, &HashKey, &vMsg)) {
+                       Msg = (message_summary*) vMsg;          
+                       display_task(Msg, 0);
                }
        }
 
@@ -107,7 +114,13 @@ void tasks_section(void) {
  */
 void calendar_section(void) {
        int num_msgs = 0;
-       int i;
+       HashPos *at;
+       const char *HashKey;
+       long HKLen;
+       void *vMsg;
+       message_summary *Msg;
+       struct wcsession *WCC = WC;
+       struct calview c;
 
        gotoroom("_CALENDAR_");
        if ( (WC->wc_view != VIEW_CALENDAR) && (WC->wc_view != VIEW_CALBRIEF) ) {
@@ -117,14 +130,18 @@ void calendar_section(void) {
                num_msgs = load_msg_ptrs("MSGS ALL", 0);
        }
 
+       parse_calendar_view_request(&c);
+
        if (num_msgs < 1) {
                wprintf("<i>");
                wprintf(_("(Nothing)"));
                wprintf("</i><br />\n");
        }
        else {
-               for (i=0; i<num_msgs; ++i) {
-                       display_calendar(WC->msgarr[i], 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_summary_view();
        }