浏览代码

fixed bugs with cache

Luke Ehresman 25 年之前
父节点
当前提交
3d41e4a130
共有 3 个文件被更改,包括 17 次插入8 次删除
  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:
 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--
 --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)  LDAP preferences in conf.pl are not working.
 (lme)  Next/Previous while viewing a message should take into account 
 (lme)  Next/Previous while viewing a message should take into account 
        the way that the mailbox is sorted.  Right now, it just does it 
        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;
       $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");
    include("../src/load_prefs.php");
    $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
    $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
    sqimap_mailbox_select($imapConnection, $mailbox);
    sqimap_mailbox_select($imapConnection, $mailbox);

+ 5 - 1
src/right_main.php

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