// GNU General Public License for more details.
#include "webcit.h"
-#include "webserver.h"
+
#include "dav.h"
#include "calendar.h"
Msg = (message_summary *)malloc(sizeof(message_summary));
if (!Msg) {
syslog(LOG_DEBUG, "malloc() error");
- TRACE;
}
memset(Msg, 0, sizeof(message_summary));
Msg->msgnum = msgnum;
Msg->MsgBody = (wc_mime_attachment*) malloc(sizeof(wc_mime_attachment));
if (!Msg->MsgBody) {
syslog(LOG_DEBUG, "malloc() error");
- TRACE;
}
memset(Msg->MsgBody, 0, sizeof(wc_mime_attachment));
Msg->MsgBody->msgnum = msgnum;
default:
case BINARY_FOLLOWS:
case SEND_BINARY:
- case START_CHAT_MODE:
+ case SEND_THEN_RECV:
case ASYNC_MSG:
case MORE_DATA:
case SEND_LISTING:
Msg = (message_summary*)malloc(sizeof(message_summary));
if (!Msg) {
syslog(LOG_DEBUG, "malloc() error");
- TRACE;
}
memset(Msg, 0, sizeof(message_summary));
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);
+ txtmail = html_to_ascii(bstr("msgtext"), 0, 80, 0);
Buf = NewStrBufPlain(txtmail, -1);
free(txtmail);
serv_puts("Content-Transfer-Encoding: quoted-printable");
serv_puts("");
serv_puts("<html><body>\r\n");
- text_to_server_qp(sbstr("msgtext")); /* Transmit message in quoted-printable encoding */
+ if (havebstr("msgtext")) {
+ text_to_server_qp(sbstr("msgtext")); /* Transmit message in quoted-printable encoding */
+ }
serv_puts("</body></html>\r\n");
if (include_text_alt) {
break;
}
syslog(LOG_DEBUG, "Attachment: raw len %d", StrLength(att->Data));
- encoded_strlen = CtdlEncodeBase64(encoded, ChrPtr(att->Data), StrLength(att->Data), 1);
+ encoded_strlen = CtdlEncodeBase64(encoded, ChrPtr(att->Data), StrLength(att->Data), BASE64_YES_LINEBREAKS);
syslog(LOG_DEBUG, "Attachment: encoded len %d", encoded_strlen);
serv_printf("--%s", top_boundary);
serv_puts("");
free(encoded);
}
- syslog(LOG_DEBUG, "\033[33m sending final boundary --%s-- \033[0m", top_boundary);
- TRACE;
serv_printf("--%s--", top_boundary);
DeleteHashPos(&it);
}
- syslog(LOG_DEBUG, "\033[33m sending terminating 000 \033[0m");
- TRACE;
serv_puts("000");
}
att = (wc_mime_attachment*)malloc(sizeof(wc_mime_attachment));
if (!att) {
syslog(LOG_DEBUG, "malloc() error");
- TRACE;
}
memset(att, 0, sizeof(wc_mime_attachment ));
att->length = WC->upload_length;
case eXclusivID:
case eJournal:
case eListID:
- case eMesageText:
+ case eMessageText:
case eMessagePath:
case eSpecialField:
case eTimestamp:
}
-/*
- * Generic function to output an arbitrary MIME part from an arbitrary
- * message number on the server.
- *
- * msgnum message number on the citadel server
- * partnum MIME part number to be output
- * force_download Nonzero to force set the Content-Type: header to "application/octet-stream"
- */
+// Generic function to output an arbitrary MIME part from an arbitrary
+// message number on the server.
+//
+// msgnum message number on the citadel server
+// partnum MIME part number to be output
+// force_download Nonzero to force set the Content-Type: header to "application/octet-stream"
+
void view_or_download_mimepart(int force_download) {
long msgnum;
off_t bytes;