From 3fb3792efcd7ce2964b19f6389359c6e725050a0 Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Tue, 23 Mar 2010 04:05:03 -0400
Subject: [PATCH] - Fix UNSEEN counting when threads and skip_deleted are both enabled (#1486558)

---
 program/include/rcube_imap.php |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/program/include/rcube_imap.php b/program/include/rcube_imap.php
index 44d23cc..d0b2908 100644
--- a/program/include/rcube_imap.php
+++ b/program/include/rcube_imap.php
@@ -490,7 +490,7 @@
    * Get message count for a specific mailbox
    *
    * @param   string   Mailbox/folder name
-   * @param   string   Mode for count [ALL|UNSEEN|RECENT]
+   * @param   string   Mode for count [ALL|THREADS|UNSEEN|RECENT]
    * @param   boolean  Force reading from server and update cache
    * @return  int      Number of messages
    * @access  public
@@ -550,7 +550,12 @@
 
       // get message count using SEARCH
       // not very performant but more precise (using UNDELETED)
+      // disable THREADS for this request
+      $threads = $this->threading;
+      $this->threading = false;
       $index = $this->_search_index($mailbox, $search_str);
+      $this->threading = $threads;
+      
       $count = is_array($index) ? count($index) : 0;
 
       if ($mode == 'ALL')

--
Gitblit v1.9.1