From 952374adbf213de98d7df5292583da17b4c38a13 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Sat, 15 Oct 2005 04:29:16 +0000 Subject: [PATCH] * Better handling of multiple recipients in reply-all --- webcit/ChangeLog | 3 +++ webcit/context_loop.c | 2 +- webcit/messages.c | 28 ++++++++++++++++++++-------- webcit/webcit.c | 8 ++++---- webcit/webserver.c | 8 ++++---- webcit/webserver.h | 2 +- 6 files changed, 33 insertions(+), 18 deletions(-) diff --git a/webcit/ChangeLog b/webcit/ChangeLog index 0e1e45033..e51ad8430 100644 --- a/webcit/ChangeLog +++ b/webcit/ChangeLog @@ -1,3 +1,6 @@ +Sat Oct 15 00:28:35 EDT 2005 Art Cancro +* Better handling of multiple recipients in reply-all + Thu Oct 13 15:30:08 EDT 2005 Art Cancro * and tags for each row in a mailbox summary view, are now output by display_summarized() instead of by readloop(). This makes the diff --git a/webcit/context_loop.c b/webcit/context_loop.c index a3541dd87..b5ccd4fde 100644 --- a/webcit/context_loop.c +++ b/webcit/context_loop.c @@ -145,7 +145,7 @@ int req_gets(int sock, char *buf, char *hold) 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); diff --git a/webcit/messages.c b/webcit/messages.c index 3559c2606..cbccab274 100644 --- a/webcit/messages.c +++ b/webcit/messages.c @@ -597,6 +597,7 @@ void read_message(long msgnum, int printable_view) { } 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))) { @@ -767,9 +768,11 @@ void read_message(long msgnum, int printable_view) { 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] ", _("ReplyAll")); } @@ -1308,12 +1311,11 @@ ENDBODY: void display_summarized(int num) { char datebuf[64]; - wprintf("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(">"); @@ -1333,11 +1335,11 @@ void display_summarized(int num) { wprintf(" "); wprintf("" "" - "\n", + "", WC->summ[num].msgnum ); - wprintf(""); + wprintf("\n"); } @@ -2044,6 +2046,16 @@ void readloop(char *oper) wprintf("
"); /* slider */ wprintf("
"); /* 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("\n"); } /* Bump these because although we're thinking in zero base, the user diff --git a/webcit/webcit.c b/webcit/webcit.c index 197e91416..2056547b1 100644 --- a/webcit/webcit.c +++ b/webcit/webcit.c @@ -235,7 +235,7 @@ void escputs(char *strbuf) void urlesc(char *outbuf, char *strbuf) { int a, b, c; - char *ec = " #&;`'|*?-~<>^()[]{}$\\"; + char *ec = " #&;`'|*?-~<>^()[]{}$\"\\"; strcpy(outbuf, ""); @@ -834,7 +834,7 @@ void end_ajax_response(void) { void session_loop(struct httprequest *req) { char cmd[1024]; - char action[128]; + char action[1024]; char arg1[128]; char arg2[128]; char arg3[128]; @@ -844,7 +844,7 @@ void session_loop(struct httprequest *req) 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; @@ -887,7 +887,7 @@ void session_loop(struct httprequest *req) 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); diff --git a/webcit/webserver.c b/webcit/webserver.c index 1515ea089..16a0ca1ca 100644 --- a/webcit/webserver.c +++ b/webcit/webserver.c @@ -286,11 +286,11 @@ int client_read(int sock, char *buf, int bytes) /* - * 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; @@ -298,13 +298,13 @@ int client_gets(int sock, char *buf) */ 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); diff --git a/webcit/webserver.h b/webcit/webserver.h index c3588ffad..5809b1aa9 100644 --- a/webcit/webserver.h +++ b/webcit/webserver.h @@ -1,5 +1,5 @@ /* $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); -- 2.39.2