]> code.citadel.org Git - citadel.git/commitdiff
* Fixed the count in 'there are xxx messages remaining." (Closes bug #61)
authorArt Cancro <ajc@citadel.org>
Thu, 6 Jul 2000 03:46:29 +0000 (03:46 +0000)
committerArt Cancro <ajc@citadel.org>
Thu, 6 Jul 2000 03:46:29 +0000 (03:46 +0000)
webcit/ChangeLog
webcit/messages.c

index d968007ea59b1ac9537c54365f1236ed6a94340f..a84f76935ba0342fe4cf28904345f901e933bc83 100644 (file)
@@ -1,4 +1,7 @@
 $Log$
+Revision 212.5  2000/07/06 03:46:29  ajc
+* Fixed the count in 'there are xxx messages remaining."  (Closes bug #61)
+
 Revision 212.4  2000/06/29 04:22:35  ajc
 * Changed the format of the wholis (again).  Now it shows up in a frame
   instead of a separate window.
@@ -461,4 +464,3 @@ Sun Dec  6 19:50:55 EST 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
 
 1998-12-03 Nathan Bryant <bryant@cs.usm.maine.edu>
        * webserver.c: warning fix
-
index 81292dad2079877901d33240d5b3bead0650e734..eafa14212d1d68e24b90d1b89137739a095a7ece 100644 (file)
@@ -285,6 +285,7 @@ void readloop(char *oper)
        int maxmsgs;
        int num_displayed = 0;
        int is_summary = 0;
+       int remaining_messages;
 
        startmsg = atol(bstr("startmsg"));
        maxmsgs = atoi(bstr("maxmsgs"));
@@ -319,6 +320,15 @@ void readloop(char *oper)
                goto DONE;
        }
 
+       remaining_messages = 0;
+       for (a = 0; a < nummsgs; ++a) {
+               if (WC->msgarr[a] >= startmsg) {
+                       ++remaining_messages;
+               }
+       }
+
+
+
        for (a = 0; a < nummsgs; ++a) {
                if (WC->msgarr[a] >= startmsg) {
 
@@ -326,11 +336,13 @@ void readloop(char *oper)
                        if (is_summary) wprintf("<BR>");
 
                        ++num_displayed;
+                       --remaining_messages;
+
                        if ( (num_displayed >= maxmsgs) && (a < nummsgs) ) {
                                wprintf("<CENTER><FONT SIZE=+1>"
                                        "There are %d more messages here."
                                        "&nbsp;&nbsp;&nbsp;</FONT>",
-                                       nummsgs - num_displayed);
+                                       remaining_messages);
                                wprintf("<A HREF=\"/readfwd?startmsg=%ld"
                                        "&maxmsgs=999999&summary=%d\">"
                                        "Read them ALL"