From 2622fb19c75ed02fd3006c0e7b69a078ca284bd4 Mon Sep 17 00:00:00 2001 From: Chuck Hagenbuch Date: Wed, 14 Jan 2009 22:42:00 -0500 Subject: [PATCH] only unflag if there are deleted messages that matched --- framework/Imap_Client/lib/Horde/Imap/Client/Socket.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/framework/Imap_Client/lib/Horde/Imap/Client/Socket.php b/framework/Imap_Client/lib/Horde/Imap/Client/Socket.php index 598d0d6a8..fd4b110ba 100644 --- a/framework/Imap_Client/lib/Horde/Imap/Client/Socket.php +++ b/framework/Imap_Client/lib/Horde/Imap/Client/Socket.php @@ -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. -- 2.11.0