From: Michael M Slusarz Date: Tue, 4 Aug 2009 07:03:17 +0000 (-0600) Subject: Improve thread sort display on servers that don't support REFERENCES sort X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=a986a5d6370e39f96c0bc3e5e45ffcafc7b31256;p=horde.git Improve thread sort display on servers that don't support REFERENCES sort --- diff --git a/imp/lib/Mailbox.php b/imp/lib/Mailbox.php index 4e2890109..357c91044 100644 --- a/imp/lib/Mailbox.php +++ b/imp/lib/Mailbox.php @@ -663,8 +663,18 @@ class IMP_Mailbox if (is_null($this->_threadob)) { try { $this->_threadob = $GLOBALS['imp_imap']->ob->thread($this->_mailbox); + $ref_errcode = null; } catch (Horde_Imap_Client_Exception $e) { - return new Horde_Imap_Client_Thread(); + $ref_errcode = $e->getCode(); + } + + if ($ref_errcode == Horde_Imap_Client_Exception::NOSUPPORTIMAPEXT) { + try { + $this->_threadob = $GLOBALS['imp_imap']->ob->thread($this->_mailbox, array('criteria' => Horde_Imap_Client::THREAD_ORDEREDSUBJECT)); + } catch (Horde_Imap_Client_Exception $e) { + $GLOBALS['notification']->push(_("Server does not support thread sorting."), 'horde.error'); + return new Horde_Imap_Client_Thread(array(), 'uid'); + } } }