comparison program/lib/Roundcube/rcube_imap.php @ 5:3a5f959af5ae

debugging aids, all commented out
author Charlie Root
date Thu, 30 Aug 2018 16:15:17 -0400
parents 4681f974d28b
children
comparison
equal deleted inserted replaced
4:1ab920879b88 5:3a5f959af5ae
812 * @return array Indexed array with message header objects 812 * @return array Indexed array with message header objects
813 * @see rcube_imap::list_messages 813 * @see rcube_imap::list_messages
814 */ 814 */
815 protected function _list_messages($folder='', $page=NULL, $sort_field=NULL, $sort_order=NULL, $slice=0) 815 protected function _list_messages($folder='', $page=NULL, $sort_field=NULL, $sort_order=NULL, $slice=0)
816 { 816 {
817 #rcube::write_log('mail',"_lm |$folder| $sort_field ".$this->threading);
817 if (!strlen($folder)) { 818 if (!strlen($folder)) {
818 return array(); 819 return array();
819 } 820 }
820 821
821 $this->set_sort_order($sort_field, $sort_order); 822 $this->set_sort_order($sort_field, $sort_order);
1396 1397
1397 return $index; 1398 return $index;
1398 } 1399 }
1399 } 1400 }
1400 1401
1402 #rcube::write_log('mail','cache? '.$this->get_mcache_engine());
1401 // check local cache 1403 // check local cache
1402 if ($mcache = $this->get_mcache_engine()) { 1404 if ($mcache = $this->get_mcache_engine()) {
1403 return $mcache->get_index($folder, $this->sort_field, $this->sort_order); 1405 return $mcache->get_index($folder, $this->sort_field, $this->sort_order);
1404 } 1406 }
1405 1407
1454 if ($this->get_capability('SORT')) { 1456 if ($this->get_capability('SORT')) {
1455 $query = $this->options['skip_deleted'] ? 'UNDELETED' : ''; 1457 $query = $this->options['skip_deleted'] ? 'UNDELETED' : '';
1456 if ($search) { 1458 if ($search) {
1457 $query = trim($query . ' UID ' . $search); 1459 $query = trim($query . ' UID ' . $search);
1458 } 1460 }
1459 1461 #rcube::write_log('mail',"abouttosort $sort_field $query");
1460 $index = $this->conn->sort($folder, $sort_field, $query, true); 1462 $index = $this->conn->sort($folder, $sort_field, $query, true);
1461 } 1463 }
1462 1464
1463 if (empty($index) || $index->is_error()) { 1465 if (empty($index) || $index->is_error()) {
1464 $index = $this->conn->index($folder, $search ? $search : "1:*", 1466 $index = $this->conn->index($folder, $search ? $search : "1:*",
1510 * 1512 *
1511 * @param rcube_result_thread $threads Threads result set 1513 * @param rcube_result_thread $threads Threads result set
1512 */ 1514 */
1513 protected function sort_threads($threads) 1515 protected function sort_threads($threads)
1514 { 1516 {
1517 #rcube::write_log('mail','sort_threads '.count($threads)." ".$this->sort_field);
1515 if ($threads->is_empty()) { 1518 if ($threads->is_empty()) {
1516 return; 1519 return;
1517 } 1520 }
1518
1519 // THREAD=ORDEREDSUBJECT: sorting by sent date of root message 1521 // THREAD=ORDEREDSUBJECT: sorting by sent date of root message
1520 // THREAD=REFERENCES: sorting by sent date of root message 1522 // THREAD=REFERENCES: sorting by sent date of root message
1521 // THREAD=REFS: sorting by the most recent date in each thread 1523 // THREAD=REFS: sorting by the most recent date in each thread
1522 1524
1523 if ($this->threading != 'REFS' || ($this->sort_field && $this->sort_field != 'date')) { 1525 if ($this->threading != 'REFS' || ($this->sort_field && $this->sort_field != 'date')) {
1524 $sortby = $this->sort_field ? $this->sort_field : 'date'; 1526 $sortby = $this->sort_field ? $this->sort_field : 'date';
1525 $index = $this->index($this->folder, $sortby, $this->sort_order, true, true); 1527 $index = $this->index($this->folder, $sortby, $this->sort_order, true, true);
1526 1528 #rcube::write_log('mail',"sort_threads $sortby".print_r($index,true));
1527 if (!$index->is_empty()) { 1529 if (!$index->is_empty()) {
1528 $threads->sort($index); 1530 $threads->sort($index);
1529 } 1531 }
1530 } 1532 }
1531 else if ($this->sort_order != $threads->get_parameters('ORDER')) { 1533 else if ($this->sort_order != $threads->get_parameters('ORDER')) {