+Sat Oct 15 00:28:35 EDT 2005 Art Cancro <ajc@uncensored.citadel.org>
+* Better handling of multiple recipients in reply-all
+
Thu Oct 13 15:30:08 EDT 2005 Art Cancro <ajc@uncensored.citadel.org>
* <tr> and </tr> tags for each row in a mailbox summary view, are now
output by display_summarized() instead of by readloop(). This makes the
if (strlen(hold) == 0) {
strcpy(buf, "");
- a = client_gets(sock, buf);
+ a = client_getln(sock, buf, SIZ);
if (a<1) return(-1);
} else {
safestrncpy(buf, hold, SIZ);
}
safestrncpy(&reply_all[strlen(reply_all)], &buf[5],
(sizeof reply_all - strlen(reply_all)) );
+ lprintf(9, "REPLY_ALL: %s\n", reply_all); // FIXME
}
if ((!strncasecmp(buf, "hnod=", 5))
&& (strcasecmp(&buf[5], serv_info.serv_humannode))) {
urlescputs(reply_to);
wprintf("?cc=");
urlescputs(reply_all);
- wprintf("?subject=");
- if (strncasecmp(m_subject, "Re:", 3)) wprintf("Re:%20");
- urlescputs(m_subject);
+ if (strlen(m_subject) > 0) {
+ wprintf("?subject=");
+ if (strncasecmp(m_subject, "Re:", 3)) wprintf("Re:%20");
+ urlescputs(m_subject);
+ }
wprintf("\">[%s]</a> ", _("ReplyAll"));
}
void display_summarized(int num) {
char datebuf[64];
- wprintf("<tr bgcolor=\"#%s\" ",
+ wprintf("<tr id=\"m%ld\" bgcolor=\"#%s\" ",
+ WC->summ[num].msgnum,
((num % 2) ? "DDDDDD" : "FFFFFF")
);
-
-
wprintf("onClick=\" new Ajax.Updater('preview_pane', '/msg', { method: 'get', parameters: 'msgnum=%ld' } ); \" ", WC->summ[num].msgnum);
wprintf(">");
wprintf(" </TD>");
wprintf("<TD>"
"<INPUT TYPE=\"checkbox\" NAME=\"msg_%ld\" VALUE=\"yes\">"
- "</TD>\n",
+ "</TD>",
WC->summ[num].msgnum
);
- wprintf("</tr>");
+ wprintf("</tr>\n");
}
wprintf("<div id=\"ml_slider\"></div>"); /* slider */
wprintf("<div id=\"preview_pane\">"); /* The preview pane will initially be empty */
+
+ /* Now register each message (whose element ID is "m9999",
+ * where "9999" is the message number) as draggable.
+ */
+ wprintf("<script type=\"text/javascript\">\n");
+ for (a = 0; a < nummsgs; ++a) {
+ wprintf("new Draggable('m%ld',{revert:true});\n",
+ WC->summ[a].msgnum);
+ }
+ wprintf("</script>\n");
}
/* Bump these because although we're thinking in zero base, the user
void urlesc(char *outbuf, char *strbuf)
{
int a, b, c;
- char *ec = " #&;`'|*?-~<>^()[]{}$\\";
+ char *ec = " #&;`'|*?-~<>^()[]{}$\"\\";
strcpy(outbuf, "");
void session_loop(struct httprequest *req)
{
char cmd[1024];
- char action[128];
+ char action[1024];
char arg1[128];
char arg2[128];
char arg3[128];
char arg7[128];
char buf[SIZ];
char request_method[128];
- char pathname[512];
+ char pathname[1024];
int a, b;
int ContentLength = 0;
int BytesRead = 0;
safestrncpy(cmd, hptr->line, sizeof cmd);
hptr = hptr->next;
extract_token(request_method, cmd, 0, ' ', sizeof request_method);
- extract_token(pathname, cmd, 1, ' ', sizeof request_method);
+ extract_token(pathname, cmd, 1, ' ', sizeof pathname);
/* Figure out the action */
extract_token(action, pathname, 1, '/', sizeof action);
/*
- * client_gets() ... Get a LF-terminated line of text from the client.
+ * client_getln() ... Get a LF-terminated line of text from the client.
* (This is implemented in terms of client_read() and could be
* justifiably moved out of sysdep.c)
*/
-int client_gets(int sock, char *buf)
+int client_getln(int sock, char *buf, int bufsiz)
{
int i, retval;
*/
for (i = 0;; i++) {
retval = client_read(sock, &buf[i], 1);
- if (retval != 1 || buf[i] == '\n' || i == 255)
+ if (retval != 1 || buf[i] == '\n' || i == (bufsiz-1))
break;
}
/* If we got a long line, discard characters until the newline.
*/
- if (i == 255)
+ if (i == (bufsiz-1))
while (buf[i] != '\n' && retval == 1)
retval = client_read(sock, &buf[i], 1);
/* $Id$ */
-int client_gets(int sock, char *buf);
+int client_getln(int sock, char *buf, int bufsiz);
int client_read(int sock, char *buf, int bytes);
int client_read_to(int sock, char *buf, int bytes, int timeout);
ssize_t client_write(const void *buf, size_t count);