Explorar o código

fixed bugs with cache

Luke Ehresman %!s(int64=25) %!d(string=hai) anos
pai
achega
3d41e4a130
Modificáronse 3 ficheiros con 17 adicións e 8 borrados
  1. 7 7
      BUG
  2. 5 0
      src/read_body.php
  3. 5 1
      src/right_main.php

+ 7 - 7
BUG

@@ -1,15 +1,15 @@
 Known BUGS to be fixed before 0.4pre1:
 
-  -    If a new message comes in while still browsing cached message 
-       list, the space is allocated, but it is blank.
-(lme)  I'm not convinced that the cache gets deleted all the time.  I'll 
-       look into this one.  
-  -    When reading through 7 unread messages, every time I would read
-       a message and click on "Message List" to go back, they would stay
-		 marked "unread".  The caching was doing too good of a job.  (:
 
 
 --SQUASHED--
+(lme)  When reading through 7 unread messages, every time I would read
+       a message and click on "Message List" to go back, they would stay
+		 marked "unread".  The caching was doing too good of a job.  (:
+(lme)  If a new message comes in while still browsing cached message 
+       list, the space is allocated, but it is blank.
+(lme)  I'm not convinced that the cache gets deleted all the time.  I'll 
+       look into this one.  
 (lme)  LDAP preferences in conf.pl are not working.
 (lme)  Next/Previous while viewing a message should take into account 
        the way that the mailbox is sorted.  Right now, it just does it 

+ 5 - 0
src/read_body.php

@@ -59,6 +59,11 @@
       $currentArrayIndex = -1;
    }
 
+	for ($i = 0; $i < count($msgs); $i++) {
+		if ($msgs[$i]["ID"] == $passed_id)
+			$msgs[$i]["FLAG_SEEN"] = true;
+	}
+
    include("../src/load_prefs.php");
    $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
    sqimap_mailbox_select($imapConnection, $mailbox);

+ 5 - 1
src/right_main.php

@@ -73,7 +73,6 @@
    }
 
    sqimap_mailbox_select($imapConnection, $mailbox);
-   $numMessages = sqimap_get_num_messages ($imapConnection, $mailbox);
    displayPageHeader($color, $mailbox);
 
 	if (isset($newsort)) {
@@ -91,6 +90,10 @@
          unset($msgs);
       if (session_is_registered("msort"))
          unset($msort);
+		if (session_is_registered("numMessages"))
+			unset($numMessages);
+
+   	$numMessages = sqimap_get_num_messages ($imapConnection, $mailbox);
 
       showMessagesForMailbox($imapConnection, $mailbox, $numMessages, $startMessage, $sort, $color, $show_num, $use_mailbox_cache);
       
@@ -98,6 +101,7 @@
          session_register("msgs");
       if (session_is_registered("msort") && isset($msort))
          session_register("msort");
+      session_register("numMessages");
    }
 
    // close the connection