From 078adf9da77f7ca6a3c02f9ef71be687aedb8856 Mon Sep 17 00:00:00 2001
From: thomascube <thomas@roundcube.net>
Date: Wed, 19 Jul 2006 15:36:35 -0400
Subject: [PATCH] Improved usability (Ticket #1483807) and HTML validity; applied patch #1328032; fixed bug #1443200

---
 program/include/rcube_imap.inc |   30 ++++++------------------------
 1 files changed, 6 insertions(+), 24 deletions(-)

diff --git a/program/include/rcube_imap.inc b/program/include/rcube_imap.inc
index bc12eac..177d05a 100644
--- a/program/include/rcube_imap.inc
+++ b/program/include/rcube_imap.inc
@@ -501,29 +501,11 @@
     $start_msg = ($this->list_page-1) * $this->page_size;
     
     list($begin, $end) = $this->_get_message_range($max, $page);
-    
-    /*    
-    if ($page=='all')
-      {
-      $begin = 0;
-      $end = $max;
-      }
-    else if (!$this->get_capability('sort') && $this->sort_order=='DESC')
-      {
-      $begin = $max - $this->page_size - $start_msg;
-      $end =   $max - $start_msg;
-      }
-    else
-      {
-      $begin = $start_msg;
-      $end   = $start_msg + $this->page_size;
-      }
-
-    if ($begin < 0) $begin = 0;
-    if ($end < 0) $end = $max;
-    if ($end > $max) $end = $max;
-	*/
-	
+  
+  	// mailbox is empty
+    if ($begin >= $end)
+      return array();
+    	
 //console("fetch headers $start_msg to ".($start_msg+$this->page_size)." (msg $begin to $end)");
 
     $headers_sorted = FALSE;
@@ -553,7 +535,7 @@
         }
       else
         {
-        $msgs = sprintf("%d:%d", $begin+1, $end);
+        $msgs = sprintf("%d:%d", $begin+1, $end);        
         $sorted = FALSE;
         }
 

--
Gitblit v1.9.1