/** start msg buttons */
+ char Urlsep = '?';
+
if (!printable_view) {
wprintf("<p id=\"msg%ld\" class=\"msgbuttons\" >\n",msgnum);
if ( (WC->wc_view == VIEW_MAILBOX) || (WC->wc_view == VIEW_BBS) ) {
wprintf("<a href=\"display_enter");
if (WC->is_mailbox) {
- wprintf("?replyquote=%ld", msgnum);
+ wprintf("%creplyquote=%ld", Urlsep, msgnum);
+ Urlsep = '&';
}
- wprintf("?recp=");
+ wprintf("%crecp=", Urlsep);
+ Urlsep = '&';
urlescputs(reply_to);
if (!IsEmptyStr(m_subject)) {
- wprintf("?subject=");
+ wprintf("%csubject=", Urlsep);
if (strncasecmp(m_subject, "Re:", 3)) wprintf("Re:%%20");
urlescputs(m_subject);
}
- wprintf("?references=");
+ wprintf("%creferences=", Urlsep);
if (!IsEmptyStr(reply_references)) {
urlescputs(reply_references);
urlescputs("|");
if (!WC->is_mailbox) {
wprintf("<a href=\"display_enter");
wprintf("?replyquote=%ld", msgnum);
- wprintf("?recp=");
+ wprintf("&recp=");
urlescputs(reply_to);
if (!IsEmptyStr(m_subject)) {
- wprintf("?subject=");
+ wprintf("&subject=");
if (strncasecmp(m_subject, "Re:", 3)) wprintf("Re:%%20");
urlescputs(m_subject);
}
- wprintf("?references=");
+ wprintf("&references=");
if (!IsEmptyStr(reply_references)) {
urlescputs(reply_references);
urlescputs("|");
if (WC->wc_view == VIEW_MAILBOX) {
wprintf("<a href=\"display_enter");
wprintf("?replyquote=%ld", msgnum);
- wprintf("?recp=");
+ wprintf("&recp=");
urlescputs(reply_to);
- wprintf("?cc=");
+ wprintf("&cc=");
urlescputs(reply_all);
if (!IsEmptyStr(m_subject)) {
- wprintf("?subject=");
+ wprintf("&subject=");
if (strncasecmp(m_subject, "Re:", 3)) wprintf("Re:%%20");
urlescputs(m_subject);
}
- wprintf("?references=");
+ wprintf("&references=");
if (!IsEmptyStr(reply_references)) {
urlescputs(reply_references);
urlescputs("|");
/* Forward */
if (WC->wc_view == VIEW_MAILBOX) {
- wprintf("<a href=\"display_enter?fwdquote=%ld?subject=", msgnum);
+ wprintf("<a href=\"display_enter?fwdquote=%ld&subject=", msgnum);
if (strncasecmp(m_subject, "Fwd:", 4)) wprintf("Fwd:%%20");
urlescputs(m_subject);
wprintf("\"><span>[</span>%s<span>]</span></a> ", _("Forward"));
/* HTML is fun, but we've got to strip it first */
else if (!strcasecmp(mime_content_type, "text/html")) {
- output_html(mime_charset, (WC->wc_view == VIEW_WIKI ? 1 : 0));
+ output_html(mime_charset, (WC->wc_view == VIEW_WIKI ? 1 : 0), msgnum);
}
/* Unknown weirdness */
|| (!strcasecmp(&WC->wc_roomname[11], USERCONFIGROOM))
|| (WC->wc_view == VIEW_ADDRESSBOOK)
) {
- wprintf("<a href=\"edit_vcard?msgnum=%ld?partnum=%s\">",
+ wprintf("<a href=\"edit_vcard?msgnum=%ld&partnum=%s\">",
msgnum, vcard_partnum);
wprintf("[%s]</a>", _("edit"));
}
while (serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
int len;
len = strlen(buf);
- if (buf[len-1] == '\n') buf[--len] = 0;
- if (buf[len-1] == '\r') buf[--len] = 0;
+ if ((len > 0) && (buf[len-1] == '\n')) buf[--len] = 0;
+ if ((len > 0) && (buf[len-1] == '\r')) buf[--len] = 0;
#ifdef HAVE_ICONV
if (ic != (iconv_t)(-1) ) {
wprintf("<tr id=\"m%ld\" style=\"font-weight:%s;\" "
"onMouseDown=\"CtdlMoveMsgMouseDown(event,%ld)\">",
WC->summ[num].msgnum,
- (WC->summ[num].is_new ? "bold" : "normal"),
+ ((WC->summ[num].is_new) ? "bold" : "normal"),
WC->summ[num].msgnum
);
|| (WC->wc_view == VIEW_ADDRESSBOOK)
) {
wprintf("<a href=\"edit_vcard?"
- "msgnum=%ld?partnum=%s\">",
+ "msgnum=%ld&partnum=%s\">",
msgnum, vcard_partnum);
wprintf("[%s]</a>", _("edit"));
}
wprintf("<td>");
- wprintf("<a href=\"readfwd?startmsg=%ld&is_singlecard=1",
+ wprintf("<a href=\"readfwd?startmsg=%ld?is_singlecard=1",
addrbook[i].ab_msgnum);
wprintf("?maxmsgs=1?is_summary=0?alpha=%s\">", bstr("alpha"));
vcard_n_prettyize(addrbook[i].ab_name);
++displayed;
}
+ /* Placeholders for empty columns at end */
+ if ((num_ab % 4) != 0) {
+ for (i=0; i<(4-(num_ab % 4)); ++i) {
+ wprintf("<td> </td>");
+ }
+ }
+
wprintf("</tr></table>\n");
end_tab((num_pages-1), num_pages);
- begin_tab(num_pages, num_pages); /* There are no submit buttons so this is empty */
+ begin_tab(num_pages, num_pages);
+ /* FIXME there ought to be something here */
end_tab(num_pages, num_pages);
for (i=0; i<num_pages; ++i) {
int is_addressbook = 0;
int is_singlecard = 0;
int is_calendar = 0;
+ struct calview calv;
int is_tasks = 0;
int is_notes = 0;
int is_bbview = 0;
struct wcsession *WCC = WC; /* This is done to make it run faster; WC is a function */
if (WCC->wc_view == VIEW_WIKI) {
- sprintf(buf, "wiki?room=%s?page=home", WCC->wc_roomname);
+ sprintf(buf, "wiki?room=%s&page=home", WCC->wc_roomname);
http_redirect(buf);
return;
}
is_calendar = 1;
strcpy(cmd, "MSGS ALL|||1");
maxmsgs = 32767;
+ parse_calendar_view_request(&calv);
}
if (WCC->wc_default_view == VIEW_TASKS) { /**< tasks */
is_tasks = 1;
if (lo < 1) lo = 1;
wprintf("<option %s value="
"\"%s"
- "?startmsg=%ld"
- "?maxmsgs=%d"
- "?is_summary=%d\">"
+ "&startmsg=%ld"
+ "&maxmsgs=%d"
+ "&is_summary=%d\">"
"%d-%d</option> \n",
((WCC->msgarr[lo-1] == startmsg) ? "selected" : ""),
oper,
if (hi > nummsgs) hi = nummsgs;
wprintf("<option %s value="
"\"%s"
- "?startmsg=%ld"
- "?maxmsgs=%d"
- "?is_summary=%d\">"
+ "&startmsg=%ld"
+ "&maxmsgs=%d"
+ "&is_summary=%d\">"
"%d-%d</option> \n",
((WCC->msgarr[b] == startmsg) ? "selected" : ""),
oper,
}
wprintf("<option value=\"%s?startmsg=%ld"
- "?maxmsgs=9999999?is_summary=%d\">",
+ "&maxmsgs=9999999&is_summary=%d\">",
oper,
WCC->msgarr[0], is_summary);
wprintf(_("All"));
addrbook[num_ab-1].ab_msgnum = WCC->msgarr[a];
}
else if (is_calendar) {
- display_calendar(WCC->msgarr[a], WCC->summ[a].is_new);
+ load_calendar_item(WCC->msgarr[a], WCC->summ[a].is_new, &calv);
}
else if (is_tasks) {
display_task(WCC->msgarr[a], WCC->summ[a].is_new);
if (lo < 1) lo = 1;
wprintf("<option %s value="
"\"%s"
- "?startmsg=%ld"
- "?maxmsgs=%d"
- "?is_summary=%d\">"
+ "&startmsg=%ld"
+ "&maxmsgs=%d"
+ "&is_summary=%d\">"
"%d-%d</option> \n",
((WCC->msgarr[lo-1] == startmsg) ? "selected" : ""),
oper,
if (hi > nummsgs) hi = nummsgs;
wprintf("<option %s value="
"\"%s"
- "?startmsg=%ld"
- "?maxmsgs=%d"
- "?is_summary=%d\">"
+ "&startmsg=%ld"
+ "&maxmsgs=%d"
+ "&is_summary=%d\">"
"%d-%d</option> \n",
((WCC->msgarr[b] == startmsg) ? "selected" : ""),
oper,
}
}
- wprintf("<option value=\"%s?startmsg=%ld"
- "?maxmsgs=9999999?is_summary=%d\">",
+ wprintf("<option value=\"%s&startmsg=%ld"
+ "&maxmsgs=9999999&is_summary=%d\">",
oper,
WCC->msgarr[0], is_summary);
wprintf(_("All"));
/** forward/reverse */
wprintf("<input type=\"radio\" %s name=\"direction\" value=\"\""
- "OnChange=\"location.href='%s?sortby=forward'\"",
+ "OnChange=\"location.href='%s&sortby=forward'\"",
(bbs_reverse ? "" : "checked"),
oper
);
wprintf(_("oldest to newest"));
wprintf(" ");
wprintf("<input type=\"radio\" %s name=\"direction\" value=\"\""
- "OnChange=\"location.href='%s?sortby=reverse'\"",
+ "OnChange=\"location.href='%s&sortby=reverse'\"",
(bbs_reverse ? "checked" : ""),
oper
);
}
if (is_calendar) {
- do_calendar_view(); /** Render the calendar */
+ render_calendar_view(&calv);
}
if (is_addressbook) {
ChrPtr(Wikipage),
ChrPtr(my_email_addr),
ChrPtr(references));
+ FreeStrBuf(&references);
lprintf(9, "%s\n", CmdBuf);
serv_puts(ChrPtr(CmdBuf));
}
sig ++;
}
+ FreeStrBuf(&Sig);
}
}