* Better handling of multiple recipients in reply-all
authorArt Cancro <ajc@citadel.org>
Sat, 15 Oct 2005 04:29:16 +0000 (04:29 +0000)
committerArt Cancro <ajc@citadel.org>
Sat, 15 Oct 2005 04:29:16 +0000 (04:29 +0000)
webcit/ChangeLog
webcit/context_loop.c
webcit/messages.c
webcit/webcit.c
webcit/webserver.c
webcit/webserver.h

index 0e1e45033fd6302894b18917822eea851948f921..e51ad843046020b56941e3e72489bd4e871982d9 100644 (file)
@@ -1,3 +1,6 @@
+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
index a3541dd87cf56a15933d843e38ef4bb2bcbc19f1..b5ccd4fde3e8c903521348f8648b4cb3efad4d18 100644 (file)
@@ -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);
index 3559c26060b6ca09e9faa0076ecfdab2abda0a80..cbccab274ac65ee50dbc1caf625fcd0be69154db 100644 (file)
@@ -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]</a> ", _("ReplyAll"));
                }
 
@@ -1308,12 +1311,11 @@ ENDBODY:
 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(">");
 
@@ -1333,11 +1335,11 @@ void display_summarized(int num) {
        wprintf(" </TD>");
        wprintf("<TD>"
                "<INPUT TYPE=\"checkbox\" NAME=\"msg_%ld\" VALUE=\"yes\">"
-               "</TD>\n",
+               "</TD>",
                WC->summ[num].msgnum
        );
 
-       wprintf("</tr>");
+       wprintf("</tr>\n");
 }
 
 
@@ -2044,6 +2046,16 @@ void readloop(char *oper)
                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
index 197e91416411115a9dbf51463f34459d41d1f04a..2056547b10d2ea8c2dc24795b896e0f4772d5628 100644 (file)
@@ -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);
index 1515ea08939f7691e9faa0db245e6e0ba67ab878..16a0ca1ca339b6816633f77ba012645e297d66c3 100644 (file)
@@ -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);
 
index c3588ffad1455f7f2beffe2dc07d8a1b524f80b8..5809b1aa9a3dd2440389dbce980773e68605bd46 100644 (file)
@@ -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);