only unflag if there are deleted messages that matched
authorChuck Hagenbuch <chuck@horde.org>
Thu, 15 Jan 2009 03:42:00 +0000 (22:42 -0500)
committerChuck Hagenbuch <chuck@horde.org>
Thu, 15 Jan 2009 03:42:00 +0000 (22:42 -0500)
framework/Imap_Client/lib/Horde/Imap/Client/Socket.php

index 598d0d6..fd4b110 100644 (file)
@@ -1328,8 +1328,9 @@ class Horde_Imap_Client_Socket extends Horde_Imap_Client_Base
 
             $res = $this->search($mailbox, $search_query);
             $unflag = $res['match'];
-
-            $this->store($mailbox, array('ids' => $unflag, 'remove' => array('\\deleted')));
+            if ($unflag) {
+                $this->store($mailbox, array('ids' => $unflag, 'remove' => array('\\deleted')));
+            }
         }
 
         /* We need to get Msgno -> UID lookup table if we are caching.