]> code.citadel.org Git - citadel.git/blobdiff - webcit/messages.c
* collect sender / read / unread information for calendar items
[citadel.git] / webcit / messages.c
index d55dc2f754e71d33a3ac71028885a92bd61a71ae..76dd1ab0f4ddf6b1b0b9c3a2894555fd995226a0 100644 (file)
@@ -493,7 +493,12 @@ void display_parsed_vcard(struct vCard *v, int full) {
                        }
                        
                        len = strlen(v->prop[i].value);
-       
+                       /* if we have some untagged QP, detect it here. */
+                       if (!is_qp && (strstr(v->prop[i].value, "=?")!=NULL))
+#ifdef HAVE_ICONV
+                               utf8ify_rfc822_string(v->prop[i].value);
+#endif
+
                        if (is_qp) {
                                // %ff can become 6 bytes in utf8 
                                thisvalue = malloc(len * 2 + 3); 
@@ -681,6 +686,9 @@ void display_vcard(char *vcard_source, char alpha, int full, char *storename) {
 
        name = vcard_get_prop(v, "n", 1, 0, 0);
        if (name != NULL) {
+#ifdef HAVE_ICONV
+               utf8ify_rfc822_string(name);
+#endif
                strcpy(buf, name);
                this_alpha = buf[0];
        }
@@ -1083,7 +1091,6 @@ void read_message(long msgnum, int printable_view, char *section) {
         */
        strcpy(mime_content_type, "text/plain");
        while (serv_getln(buf, sizeof buf), (!IsEmptyStr(buf))) {
-               lprintf(9, "GOT: <%s>\n", buf);
                if (!strcmp(buf, "000")) {
                        /* This is not necessarily an error condition.  See bug #226. */
                        goto ENDBODY;
@@ -2339,7 +2346,7 @@ void readloop(char *oper)
         * new messages.
         */
        strcpy(old_msgs, "");
-       if (is_summary) {
+       if ((is_summary) || (WCC->wc_default_view == VIEW_CALENDAR)){
                serv_puts("GTSN");
                serv_getln(buf, sizeof buf);
                if (buf[0] == '2') {
@@ -2351,7 +2358,7 @@ void readloop(char *oper)
 
        if (WCC->wc_default_view == VIEW_CALENDAR) {            /**< calendar */
                is_calendar = 1;
-               strcpy(cmd, "MSGS ALL");
+               strcpy(cmd, "MSGS ALL|||1");
                maxmsgs = 32767;
        }
        if (WCC->wc_default_view == VIEW_TASKS) {               /**< tasks */
@@ -2388,7 +2395,7 @@ void readloop(char *oper)
                goto DONE;
        }
 
-       if (is_summary) {
+       if ((is_summary) || (WCC->wc_default_view == VIEW_CALENDAR)){
                for (a = 0; a < nummsgs; ++a) {
                        /** Are you a new message, or an old message? */
                        if (is_summary) {
@@ -2631,13 +2638,13 @@ void readloop(char *oper)
                                addrbook[num_ab-1].ab_msgnum = WCC->msgarr[a];
                        }
                        else if (is_calendar) {
-                               display_calendar(WCC->msgarr[a]);
+                               display_calendar(WCC->msgarr[a], WCC->summ[a].is_new);
                        }
                        else if (is_tasks) {
-                               display_task(WCC->msgarr[a]);
+                               display_task(WCC->msgarr[a], WCC->summ[a].is_new);
                        }
                        else if (is_notes) {
-                               display_note(WCC->msgarr[a]);
+                               display_note(WCC->msgarr[a], WCC->summ[a].is_new);
                        }
                        else {
                                if (displayed_msgs == NULL) {