* @param array $options Additional options:
* <pre>
* 'criteria' - (mixed) The following thread criteria are available:
- * Horde_Imap_Client::THREAD_ORDEREDSUBJECT, and
- * Horde_Imap_Client::THREAD_REFERENCES. Additionally, other
+ * Horde_Imap_Client::THREAD_ORDEREDSUBJECT,
+ * Horde_Imap_Client::THREAD_REFERENCES, and
+ * Horde_Imap_Client::THREAD_REFS. Additionally, other
* algorithms can be explicitly specified by passing the IMAP
* thread algorithm in as a string.
* 'search' - (object) The search query (a
* RFC 5464 - METADATA
*
* draft-ietf-morg-sortdisplay-02 - SORT=DISPLAY
+ * draft-ietf-morg-inthread-00 - THREAD=REFS
*
* [NO RFC] - XIMAPPROXY
* + Requires imapproxy v1.2.7-rc1 or later
* RFC 5465 - NOTIFY
* RFC 5466 - FILTERS
*
+ * draft-ietf-morg-inthread-00 - SEARCH=INTHREAD
+ *
* Originally based on code from:
* + auth.php (1.49)
* + imap_general.php (1.212)
{
$thread_criteria = array(
Horde_Imap_Client::THREAD_ORDEREDSUBJECT => 'ORDEREDSUBJECT',
- Horde_Imap_Client::THREAD_REFERENCES => 'REFERENCES'
+ Horde_Imap_Client::THREAD_REFERENCES => 'REFERENCES',
+ Horde_Imap_Client::THREAD_REFERENCES => 'REFS'
);
$tsort = (isset($options['criteria']))
$cap = $this->queryCapability('THREAD');
if (!$cap || !in_array($tsort, $cap)) {
- if ($tsort == 'ORDEREDSUBJECT') {
+ switch ($tsort) {
+ case 'ORDEREDSUBJECT':
if (empty($options['search'])) {
$ids = array();
} else {
/* Do client-side ORDEREDSUBJECT threading. */
$fetch_res = $this->fetch($this->_selected, array(Horde_Imap_Client::FETCH_ENVELOPE => true, Horde_Imap_Client::FETCH_DATE => true), array('ids' => $ids, 'sequence' => !empty($options['sequence'])));
return $this->_clientThreadOrderedsubject($fetch_res);
- } else {
- throw new Horde_Imap_Client_Exception('Server does not support REFERENCES thread sort.', Horde_Imap_Client_Exception::NOSUPPORTIMAPEXT);
+
+ case 'REFERENCES':
+ case 'REFS':
+ throw new Horde_Imap_Client_Exception('Server does not support ' . $tsort . ' thread sort.', Horde_Imap_Client_Exception::NOSUPPORTIMAPEXT);
}
}
<api>alpha</api>
</stability>
<license uri="http://www.gnu.org/copyleft/lesser.html">LGPL</license>
- <notes>* Add support for RFC 5258 (LIST-EXTENDED).
+ <notes>* Add support for THREAD=REFS (draft-ietf-morg-inthread-00).
+ * Add support for RFC 5258 (LIST-EXTENDED).
* Add Horde_Imap_Client_Utils::createUrl().
* Support SORT=DISPLAY extension.
* Added search and thread (message list) caching.