#include "webcit.h"
#include "webserver.h"
#include "groupdav.h"
+#include "html.h"
#define SUBJ_COL_WIDTH_PCT 50 /**< Mailbox view column width */
#define SENDER_COL_WIDTH_PCT 30 /**< Mailbox view column width */
* 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') {
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 */
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) {
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) {
static int seq = 0;
struct wc_attachment *att;
char *encoded;
+ char *txtmail;
size_t encoded_length;
size_t encoded_strlen;
is_multipart = 1;
}
- if (is_multipart) {
+// if (is_multipart) {
sprintf(boundary, "Citadel--Multipart--%s--%04x--%04x",
serv_info.serv_fqdn,
getpid(),
);
/** Remember, serv_printf() appends an extra newline */
- serv_printf("Content-type: multipart/mixed; "
- "boundary=\"%s\"\n", boundary);
+ if (is_multipart)
+ serv_printf("Content-type: multipart/mixed; "
+ "boundary=\"%s\"\n", boundary);
+ else
+ serv_printf("Content-type: multipart/alternative; "
+ "boundary=\"%s\"\n", boundary);
serv_printf("This is a multipart message in MIME format.\n");
serv_printf("--%s", boundary);
- }
+// }
serv_puts("Content-type: text/html; charset=utf-8");
serv_puts("Content-Transfer-Encoding: quoted-printable");
serv_puts("<html><body>\r\n");
text_to_server_qp(bstr("msgtext")); /** Transmit message in quoted-printable encoding */
serv_puts("</body></html>\r\n");
+
+ serv_puts("Content-type: text/plain; charset=utf-8");
+ serv_puts("Content-Transfer-Encoding: quoted-printable");
+ serv_puts("");
+
+ txtmail = html_to_ascii(bstr("msgtext"), 0, 80, 0);
+ text_to_server_qp(txtmail); /** Transmit message in quoted-printable encoding */
+ free(txtmail);
+ if (!is_multipart)
+ serv_printf("--%s", boundary);
if (is_multipart) {