int nhdr = 0;
int bq = 0;
char vcard_partnum[SIZ];
- char *vcard_source = NULL;
+ char cal_partnum[SIZ];
+ char *part_source = NULL;
strcpy(from, "");
strcpy(node, "");
strcpy(rfca, "");
strcpy(reply_to, "");
strcpy(vcard_partnum, "");
+ strcpy(cal_partnum, "");
serv_printf("MSG4 %ld", msgnum);
serv_gets(buf);
msgnum, mime_partnum);
}
+ /*** begin handler prep ***/
if (!strcasecmp(mime_content_type, "text/x-vcard")) {
strcpy(vcard_partnum, mime_partnum);
}
+ if (!strcasecmp(mime_content_type, "text/calendar")) {
+ strcpy(cal_partnum, mime_partnum);
+ }
+
+ /*** end handler prep ***/
+
}
}
free(mime_http);
}
+ /* Handler for vCard parts */
if (strlen(vcard_partnum) > 0) {
- vcard_source = load_mimepart(msgnum, vcard_partnum);
- if (vcard_source != NULL) {
+ part_source = load_mimepart(msgnum, vcard_partnum);
+ if (part_source != NULL) {
/* If it's my vCard I can edit it */
if ( (!strcasecmp(WC->wc_roomname, USERCONFIGROOM))
}
/* In all cases, display the full card */
- display_vcard(vcard_source, 0, 1);
- free(vcard_source);
+ display_vcard(part_source, 0, 1);
}
}
+ /* Handler for calendar parts */
+ if (strlen(cal_partnum) > 0) {
+ part_source = load_mimepart(msgnum, cal_partnum);
+ if (part_source != NULL) {
+ cal_process_attachment(part_source);
+ }
+ }
+
+ if (part_source) {
+ free(part_source);
+ part_source = NULL;
+ }
+
}
int num_displayed = 0;
int is_summary = 0;
int is_addressbook = 0;
+ int is_calendar = 0;
+ int is_tasks = 0;
int remaining_messages;
int lo, hi;
int lowest_displayed = (-1);
else wprintf("<A HREF=\"/readfwd?alpha=1\">(other)</A>\n");
wprintf("<HR width=100%%>\n");
}
+ if (WC->wc_view == 3) { /* calendar */
+ is_calendar = 1;
+ strcpy(cmd, "MSGS ALL");
+ maxmsgs = 32767;
+ }
+ if (WC->wc_view == 4) { /* tasks */
+ is_tasks = 1;
+ strcpy(cmd, "MSGS ALL");
+ maxmsgs = 32767;
+ wprintf("<UL>");
+ }
nummsgs = load_msg_ptrs(cmd);
if (nummsgs == 0) {
- if (!strcmp(oper, "readnew")) {
- wprintf("<EM>No new messages in this room.</EM>\n");
- } else if (!strcmp(oper, "readold")) {
- wprintf("<EM>No old messages in this room.</EM>\n");
- } else {
- wprintf("<EM>This room is empty.</EM>\n");
+
+ if ((!is_tasks) && (!is_calendar)) {
+ if (!strcmp(oper, "readnew")) {
+ wprintf("<EM>No new messages in this room.</EM>\n");
+ } else if (!strcmp(oper, "readold")) {
+ wprintf("<EM>No old messages in this room.</EM>\n");
+ } else {
+ wprintf("<EM>This room is empty.</EM>\n");
+ }
}
+
goto DONE;
}
else if (is_addressbook) {
display_addressbook(WC->msgarr[a], alpha);
}
+ else if (is_calendar) {
+ display_calendar(WC->msgarr[a]);
+ }
+ else if (is_tasks) {
+ display_task(WC->msgarr[a]);
+ }
else {
read_message(WC->msgarr[a]);
}
wprintf("</TABLE>\n");
}
+ if (is_tasks) {
+ wprintf("</UL>\n");
+ }
+
/* Bump these because although we're thinking in zero base, the user
* is a drooling idiot and is thinking in one base.
*/
}
if (is_summary) wprintf("</FORM>\n");
-DONE: wDumpContent(1);
+DONE:
+ if (is_tasks) {
+ wprintf("<A HREF=\"/display_edit_task?msgnum=0\">"
+ "Add new task</A>\n"
+ );
+ }
+
+ if (is_calendar) {
+ do_calendar_view();
+ }
+
+ wDumpContent(1);
}