From 6f31b356b2b21882b439324d233aceec413f4737 Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Wed, 31 Mar 2010 03:14:32 -0400
Subject: [PATCH] - fix save/delete draft message with enabled threading (#1486596) - performance improvement using UID SEARCH intead of SEARCH + FETCH - re-fix r3445

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

diff --git a/program/include/rcube_imap.php b/program/include/rcube_imap.php
index 26d0ef4..7dc70df 100644
--- a/program/include/rcube_imap.php
+++ b/program/include/rcube_imap.php
@@ -1414,6 +1414,27 @@
         return $a_messages;
     }
     
+
+    /**
+     * Direct (real and simple) SEARCH request to IMAP server,
+     * without result sorting and caching
+     *
+     * @param  string  Mailbox name to search in
+     * @param  string  Search string
+     * @param  boolean True if UIDs should be returned
+     * @return array   Search results as list of message IDs or UIDs
+     * @access public
+     */
+    function search_once($mbox_name='', $str=NULL, $ret_uid=false)
+    {
+        if (!$str)
+            return false;
+    
+        $mailbox = $mbox_name ? $this->mod_mailbox($mbox_name) : $this->mailbox;
+
+        return $this->conn->search($mailbox, $str, $ret_uid);
+    }
+
   
     /**
      * Sort thread

--
Gitblit v1.9.1