char node[256];
char rfca[256];
char reply_to[512];
- char now[256];
+ char reply_all[4096];
+ char now[64];
int format_type = 0;
int nhdr = 0;
int bq = 0;
strcpy(node, "");
strcpy(rfca, "");
strcpy(reply_to, "");
+ strcpy(reply_all, "");
strcpy(vcard_partnum, "");
strcpy(cal_partnum, "");
strcpy(mime_http, "");
}
if (!strncasecmp(buf, "cccc=", 5)) {
safestrncpy(m_cc, &buf[5], sizeof m_cc);
+ if (strlen(reply_all) > 0) {
+ strcat(reply_all, ", ");
+ }
+ safestrncpy(&reply_all[strlen(reply_all)], &buf[5],
+ (sizeof reply_all - strlen(reply_all)) );
}
if ((!strncasecmp(buf, "hnod=", 5))
&& (strcasecmp(&buf[5], serv_info.serv_humannode))) {
wprintf(_("to "));
escputs(&buf[5]);
wprintf(" ");
+ if (strlen(reply_all) > 0) {
+ strcat(reply_all, ", ");
+ }
+ safestrncpy(&reply_all[strlen(reply_all)], &buf[5],
+ (sizeof reply_all - strlen(reply_all)) );
}
if (!strncasecmp(buf, "time=", 5)) {
fmt_date(now, atol(&buf[5]), 0);
urlescputs(m_subject);
wprintf("\">[%s]</a> ", _("Reply"));
+ /* ReplyAll */
+ if (WC->wc_view == VIEW_MAILBOX) {
+ wprintf("<a href=\"/display_enter?recp=");
+ urlescputs(reply_to);
+ wprintf("?cc=");
+ urlescputs(reply_all);
+ wprintf("?subject=");
+ if (strncasecmp(m_subject, "Re:", 3)) wprintf("Re:%20");
+ urlescputs(m_subject);
+ wprintf("\">[%s]</a> ", _("ReplyAll"));
+ }
+
/* Forward */
if (WC->wc_view == VIEW_MAILBOX) {
wprintf("<a href=\"/display_enter?pullquote=%ld?subject=", msgnum);
targetdiv = bstr("targetdiv");
print_it = bstr("print_it");
- output_headers(1, 0, 0, 0, 0, 1, 0);
+ output_headers(1, 0, 0, 0, 1, 0);
begin_burst();
wprintf("<html><head>");
char tablast_label[SIZ];
if (num_ab == 0) {
- wprintf("<I>");
+ wprintf("<br /><br /><br /><div align=\"center\"><i>");
wprintf(_("This address book is empty."));
- wprintf("</I>\n");
+ wprintf("</i></div>\n");
return;
}
if (strlen(sortby) == 0) sortby = sortpref_value;
if (strlen(sortby) == 0) sortby = "msgid";
- output_headers(1, 1, 1, 0, 0, 0, 0);
+ output_headers(1, 1, 1, 0, 0, 0);
/* When in summary mode, always show ALL messages instead of just
* new or old. Otherwise, show what the user asked for.
nummsgs = load_msg_ptrs(cmd, is_summary);
if (nummsgs == 0) {
- if ((!is_tasks) && (!is_calendar) && (!is_notes)) {
+ if ((!is_tasks) && (!is_calendar) && (!is_notes) && (!is_addressbook)) {
wprintf("<em>");
if (!strcmp(oper, "readnew")) {
wprintf(_("No new messages."));
/*
* Otherwise proceed normally.
-` * Do a custom room banner with no navbar...
+ * Do a custom room banner with no navbar...
*/
- output_headers(1, 1, 2, 0, 0, 0, 0);
+ output_headers(1, 1, 2, 0, 0, 0);
wprintf("<div id=\"banner\">\n");
embed_room_banner(NULL, navbar_none);
wprintf("</div>\n");
"<div id=\"fix_scrollbar_bug\">"
"<table width=100%% border=0 bgcolor=\"#ffffff\"><tr><td>");
- sprintf(buf, "ENT0 0|%s|0|0||||%s|%s", bstr("recp"), bstr("cc"), bstr("bcc"));
- serv_puts(buf);
+ /* First test to see whether this is a room that requires recipients to be entered */
+ serv_puts("ENT0 0");
serv_getln(buf, sizeof buf);
-
- if (!strncmp(buf, "570", 3)) {
+ if (!strncmp(buf, "570", 3)) { /* 570 means that we need a recipient here */
recipient_required = 1;
- if (strlen(bstr("recp")) + strlen(bstr("cc")) + strlen(bstr("bcc")) > 0) {
- recipient_bad = 1;
- }
}
- else if (buf[0] != '2') {
+ else if (buf[0] != '2') { /* Any other error means that we cannot continue */
wprintf("<EM>%s</EM><br />\n", &buf[4]);
goto DONE;
}
+ /* Now check our actual recipients if there are any */
+ if (recipient_required) {
+ sprintf(buf, "ENT0 0|%s|0|0||||%s|%s", bstr("recp"), bstr("cc"), bstr("bcc"));
+ serv_puts(buf);
+ serv_getln(buf, sizeof buf);
+
+ if (!strncmp(buf, "570", 3)) { /* 570 means we have an invalid recipient listed */
+ if (strlen(bstr("recp")) + strlen(bstr("cc")) + strlen(bstr("bcc")) > 0) {
+ recipient_bad = 1;
+ }
+ }
+ else if (buf[0] != '2') { /* Any other error means that we cannot continue */
+ wprintf("<EM>%s</EM><br />\n", &buf[4]);
+ goto DONE;
+ }
+ }
+
+ /* If we got this far, we can display the message entry screen. */
+
now = time(NULL);
fmt_date(buf, now, 0);
strcat(&buf[strlen(buf)], _(" <I>from</I> "));
stresc(&buf[strlen(buf)], WC->wc_username, 1, 1);
+
+ /* Don't need this anymore, it's in the input box below
if (strlen(bstr("recp")) > 0) {
strcat(&buf[strlen(buf)], _(" <I>to</I> "));
stresc(&buf[strlen(buf)], bstr("recp"), 1, 1);
}
+ */
+
strcat(&buf[strlen(buf)], _(" <I>in</I> "));
stresc(&buf[strlen(buf)], WC->wc_roomname, 1, 1);
wprintf("<div class=\"auto_complete\" id=\"bcc_name_choices\"></div>");
wprintf("</td><td></td></tr>\n");
- /* Initialize the autocomplete ajax helpers */
- wprintf("<script type=\"text/javascript\"> \n"
- " new Ajax.Autocompleter('cc_id', 'cc_name_choices', \n"
- " '/cc_autocomplete', {} ); \n"
- " new Ajax.Autocompleter('bcc_id', 'bcc_name_choices', \n"
- " '/bcc_autocomplete', {} ); \n"
- " new Ajax.Autocompleter('recp_id', 'recp_name_choices', \n"
- " '/recp_autocomplete', {} ); \n"
- "</script> \n"
+ /* Initialize the autocomplete ajax helpers (found in wclib.js) */
+ wprintf("<script type=\"text/javascript\"> \n"
+ " activate_entmsg_autocompleters(); \n"
+ "</script> \n"
);
-
}
wprintf("<tr><td>");
msgid = atol(bstr("msgid"));
- output_headers(1, 1, 1, 0, 0, 0, 0);
+ output_headers(1, 1, 1, 0, 0, 0);
sprintf(buf, "DELE %ld", msgid);
serv_puts(buf);
msgid = atol(bstr("msgid"));
- output_headers(1, 1, 1, 0, 0, 0, 0);
+ output_headers(1, 1, 1, 0, 0, 0);
wprintf("<div id=\"fix_scrollbar_bug\">"
"<table width=100%% border=0 bgcolor=\"#444455\"><tr><td>");
msgid = atol(bstr("msgid"));
- output_headers(1, 1, 1, 0, 0, 0, 0);
+ output_headers(1, 1, 1, 0, 0, 0);
if (strlen(bstr("move_button")) > 0) {
sprintf(buf, "MOVE %ld|%s", msgid, bstr("target_room"));