From 10e9efd652db175a4b63c9d699c98c4bf8dc644b Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Thu, 8 Jan 2009 12:03:01 -0700 Subject: [PATCH] Merge capability information on login. Some servers don't provide full capability information on login response, so merge this information with the previously cached info. --- framework/Imap_Client/lib/Horde/Imap/Client/Socket.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/framework/Imap_Client/lib/Horde/Imap/Client/Socket.php b/framework/Imap_Client/lib/Horde/Imap/Client/Socket.php index 749ab4bf0..c276dcbac 100644 --- a/framework/Imap_Client/lib/Horde/Imap/Client/Socket.php +++ b/framework/Imap_Client/lib/Horde/Imap/Client/Socket.php @@ -145,7 +145,11 @@ class Horde_Imap_Client_Socket extends Horde_Imap_Client_Base } $c = &$this->_init['capability']; - $c = array(); + if (empty($this->_temp['in_login'])) { + $c = array(); + } else { + $this->_temp['logincapset'] = true; + } foreach ($data as $val) { $cap_list = explode('=', $val); @@ -165,10 +169,6 @@ class Horde_Imap_Client_Socket extends Horde_Imap_Client_Base if (isset($c['QRESYNC'])) { $c['CONDSTORE'] = true; } - - if (!empty($this->_temp['in_login'])) { - $this->_temp['logincapset'] = true; - } } /** @@ -340,8 +340,10 @@ class Horde_Imap_Client_Socket extends Horde_Imap_Client_Base /* Set a flag indicating whether we have received a CAPABILITY * response after we successfully login. Since capabilities may - * be different after login, this is the value we should end up - * caching if the object is eventually serialized. */ + * be different after login, we need to merge this information into + * the current CAPABILITY array (since some servers, e.g. Cyrus, + * may not include authentication capabilities that are still + * needed in the event this object is eventually serialized). */ $this->_temp['in_login'] = true; try { -- 2.11.0