*/
/*@{*/
#include "webcit.h"
-#include "vcard.h"
#include "webserver.h"
#include "groupdav.h"
* \param maxlen Maximum size of target buffer.
* \param source Source string to be encoded.
*/
-void rfc2047encode(char *target, int maxlen, char *source)
+void webcit_rfc2047encode(char *target, int maxlen, char *source)
{
int need_to_encode = 0;
int i, len;
}
else if (!strcasecmp(firsttoken, "email")) {
+ size_t len;
if (!IsEmptyStr(mailto)) strcat(mailto, "<br />");
- long len;
strcat(mailto,
"<a href=\"display_enter"
"?force_room=_MAIL_?recp=");
- urlesc(&mailto[strlen(mailto)], fullname);
- urlesc(&mailto[strlen(mailto)], " <");
- urlesc(&mailto[strlen(mailto)], thisvalue);
- urlesc(&mailto[strlen(mailto)], ">");
+ len = strlen(mailto);
+ urlesc(&mailto[len], SIZ - len, fullname);
+ len = strlen(mailto);
+ urlesc(&mailto[len], SIZ - len, " <");
+ len = strlen(mailto);
+ urlesc(&mailto[len], SIZ - len, thisvalue);
+ len = strlen(mailto);
+ urlesc(&mailto[len], SIZ - len, ">");
strcat(mailto, "\">");
len = strlen(mailto);
wprintf(" ");
}
if (!strncasecmp(buf, "time=", 5)) {
- fmt_date(now, atol(&buf[5]), 0);
+ webcit_fmt_date(now, atol(&buf[5]), 0);
wprintf("<span>");
wprintf("%s ", now);
wprintf("</span>");
attach_links = realloc(attach_links,
(num_attach_links*sizeof(struct attach_link)));
safestrncpy(attach_links[num_attach_links-1].partnum, mime_partnum, 32);
- urlesc(escaped_mime_filename, mime_filename);
+ urlesc(escaped_mime_filename, 265, mime_filename);
snprintf(attach_links[num_attach_links-1].html, 1024,
"<img src=\"static/diskette_24x.gif\" "
"border=0 align=middle>\n"
strcpy(vcard_partnum, mime_partnum);
}
- if (!strcasecmp(mime_content_type, "text/calendar")) {
+ if ( (!strcasecmp(mime_content_type, "text/calendar"))
+ || (!strcasecmp(mime_content_type, "application/ics")) ) {
strcpy(cal_partnum, mime_partnum);
}
wprintf("%s ", &buf[5]);
}
if (!strncasecmp(buf, "time=", 5)) {
- fmt_date(now, atol(&buf[5]), 0);
+ webcit_fmt_date(now, atol(&buf[5]), 0);
wprintf("%s ", now);
}
}
);
wprintf("<td width=%d%%>", SUBJ_COL_WIDTH_PCT);
- escputs(WC->summ[num].subj);
+
+#ifdef HAVE_ICONV
+ utf8ify_rfc822_string(WC->summ[num].subj);
+ utf8ify_rfc822_string(WC->summ[num].from);
+#endif
+ escputs(WC->summ[num].subj);//////////////////////////////////TODO: QP DECODE
wprintf("</td>");
wprintf("<td width=%d%%>", SENDER_COL_WIDTH_PCT);
wprintf("</td>");
wprintf("<td width=%d%%>", DATE_PLUS_BUTTONS_WIDTH_PCT);
- fmt_date(datebuf, WC->summ[num].date, 1); /* brief */
+ webcit_fmt_date(datebuf, WC->summ[num].date, 1); /* brief */
escputs(datebuf);
wprintf("</td>");
*/
if (is_bbview) {
/** begin bbview scroller */
- wprintf("<form name=\"msgomatictop\" class=\"selector_top\" >");
+ wprintf("<form name=\"msgomatictop\" class=\"selector_top\" > \n <p>");
wprintf(_("Reading #"), lowest_displayed, highest_displayed);
wprintf("<select name=\"whichones\" size=\"1\" "
wprintf(_("newest to oldest"));
wprintf("\n");
- wprintf("</select></form>\n");
+ wprintf("</p></form>\n");
/** end bbview scroller */
}
-
for (a = 0; a < nummsgs; ++a) {
if ((WCC->msgarr[a] >= startmsg) && (num_displayed < maxmsgs)) {
*/
if (is_bbview) {
/** begin bbview scroller */
- wprintf("<form name=\"msgomatic\" class=\"selector_bottom\" >");
+ wprintf("<form name=\"msgomatic\" class=\"selector_bottom\" > \n <p>");
wprintf(_("Reading #"), lowest_displayed, highest_displayed);
wprintf("<select name=\"whichones\" size=\"1\" "
wprintf(_("newest to oldest"));
wprintf("\n");
- wprintf("</form>\n");
+ wprintf("</p></form>\n");
/** end bbview scroller */
}
encoded_length = ((att->length * 150) / 100);
encoded = malloc(encoded_length);
if (encoded == NULL) break;
- encoded_strlen = CtdlEncodeBase64(&encoded, att->data, att->length, &encoded_length, 1);
+ encoded_strlen = CtdlEncodeBase64(encoded, att->data, att->length, 1);
serv_printf("--%s", boundary);
serv_printf("Content-type: %s", att->content_type);
int is_anonymous = 0;
char *display_name;
+ if (!IsEmptyStr(bstr("force_room"))) {
+ gotoroom(bstr("force_room"));
+ }
+
display_name = bstr("display_name");
if (!strcmp(display_name, "__ANONYMOUS__")) {
display_name = "";
_("Automatically cancelled because you have already "
"saved this message."));
} else {
- rfc2047encode(encoded_subject, sizeof encoded_subject, bstr("subject"));
+ webcit_rfc2047encode(encoded_subject, sizeof encoded_subject, bstr("subject"));
sprintf(buf, "ENT0 1|%s|%d|4|%s|%s||%s|%s|%s|%s",
bstr("recp"),
is_anonymous,
}
wprintf("<input type=\"hidden\" name=\"return_to\" value=\"%s\">\n", bstr("return_to"));
wprintf("<input type=\"hidden\" name=\"nonce\" value=\"%ld\">\n", WC->nonce);
+ wprintf("<input type=\"hidden\" name=\"force_room\" value=\"");
+ escputs(WC->wc_roomname);
+ wprintf("\">\n");
/** submit or cancel buttons */
wprintf("<p class=\"send_edit_msg\">");
wprintf("<img src=\"static/newmess3_24x.gif\" class=\"imgedit\">");
wprintf(" "); /** header bar */
- fmt_date(buf, now, 0);
+ webcit_fmt_date(buf, now, 0);
wprintf("%s", buf);
wprintf("\n"); /** header bar */
escputs(bstr("recp"));
wprintf("\" size=45 maxlength=1000 />");
wprintf("<div class=\"auto_complete\" id=\"recp_name_choices\"></div>");
- wprintf("</td><td rowspan=\"3\" align=\"left\" valign=\"top\"");
+ wprintf("</td><td rowspan=\"3\" align=\"left\" valign=\"top\">");
/** Pop open an address book -- begin **/
wprintf(
}
wprintf("</label></th>"
"<td colspan=\"2\">"
- "<input type=\"text\" name=\"subject\" id=\"subject_id\" value=\" ");
+ "<input type=\"text\" name=\"subject\" id=\"subject_id\" value=\"");
escputs(bstr("subject"));
wprintf("\" size=45 maxlength=70>\n");
wprintf("</td></tr>");
}
}
- wprintf("</textarea>");
+ wprintf("</textarea>\n");
+ /** Make sure we only insert our signature once */
+ /** We don't care if it was there or not before, it needs to be there now. */
+ wprintf("<input type=\"hidden\" name=\"sig_inserted\" value=\"yes\">\n");
+
/**
* The following template embeds the TinyMCE richedit control, and automatically
* transforms the textarea into a richedit textarea.
wprintf(" <input name=\"attachfile\" class=\"attachfile\" "
"size=16 type=\"file\">\n "
"<input type=\"submit\" name=\"attach_button\" value=\"%s\">\n", _("Add"));
- wprintf("</div>");
+ wprintf("</div>"); /* End of "attachment buttons" div */
- /** Make sure we only insert our signature once */
- if (strcmp(bstr("sig_inserted"), "yes")) {
- wprintf("<input type=\"hidden\" name=\"sig_inserted\" value=\"yes\">\n");
- }
-
wprintf("</td></tr></table>");
wprintf("</form>\n");
- wprintf("</div></div>\n");
+ wprintf("</div>\n"); /* end of "fix_scrollbar_bug" div */
+ /* NOTE: address_book_popup() will close the "content" div. Don't close it here. */
DONE: address_book_popup();
wDumpContent(1);
}