Update of /cvsroot/tmda/tmda/contrib/cgi
In directory sc8-pr-cvs1:/tmp/cvs-serv3659

Modified Files:
        Pending.py View.py 
Log Message:
Keep track of messages in PENDING_CACHE and highlight read and unread messages
with an appropriate CSS style.


Index: Pending.py
===================================================================
RCS file: /cvsroot/tmda/tmda/contrib/cgi/Pending.py,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- Pending.py  1 Feb 2003 17:09:57 -0000       1.12
+++ Pending.py  14 Feb 2003 19:01:51 -0000      1.13
@@ -74,8 +74,9 @@
           except IOError: pass
 
   # Locate messages in pending dir
-  Queue = Pending.Queue(descending = (PVars["SortDir"] == "desc"))
+  Queue = Pending.Queue(descending = (PVars["SortDir"] == "desc"), cache = 1)
   Queue.initQueue()
+  Queue._loadCache()
   Msgs = Queue.listPendingIds()
   
   # Any messages no longer "in process"?
@@ -251,7 +252,7 @@
             cgi.escape(Subject[:Defaults.CGI_CROP_SUBJECT - 1]) + "…"
         else:
           Subject = cgi.escape(Subject)
-
+      
       # From:
       if not MsgObj.msgobj["from"]:
         From = ""
@@ -284,8 +285,14 @@
 </table>"""
       else:
         # Message is not "in process"
-        print """          <tr> 
-            <td nowrap>
+
+        # Read this one yet?
+        if Msg in Queue.msgcache:
+          print "<tr class=OldMsg>"
+        else:
+          print "<tr class=NewMsg>"
+
+        print """            <td nowrap>
               <table cellpadding="0" cellspacing="0" border="0">
                  <tr>
          <td width=24><input name="a%d" type="radio" value="pass" checked></td>

Index: View.py
===================================================================
RCS file: /cvsroot/tmda/tmda/contrib/cgi/View.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- View.py     1 Feb 2003 17:09:57 -0000       1.9
+++ View.py     14 Feb 2003 19:01:52 -0000      1.10
@@ -76,11 +76,14 @@
       "Program error / corrupted link.", "retrieve pending e-mail", "",
       "Recheck link or contact TMDA programmers.")
 
+  # Fetch the queue
+  Queue = Pending.Queue(descending = (PVars["SortDir"] == "desc"), cache = 1)
+  Queue.initQueue()
+  Queue._loadCache()
+  
   # Any subcommands?
   if Form.has_key("subcmd"):
     # Locate messages in pending dir
-    Queue = Pending.Queue(descending = (PVars["SortDir"] == "desc"))
-    Queue.initQueue()
     Msgs = Queue.listPendingIds()
     try:
       MsgIdx = Msgs.index(PVars["MsgID"])
@@ -149,6 +152,8 @@
   
   # Read in e-mail
   MsgObj = Pending.Message(PVars["MsgID"])
+  Queue._addCache(PVars["MsgID"])
+  Queue._saveCache()
   
   if PVars["Headers"] == "all":
     # Generate all headers

_______________________________________
tmda-cvs mailing list
http://tmda.net/lists/listinfo/tmda-cvs

Reply via email to