*/
protected function _getSeqUIDLookup($ids, $seq)
{
- $search = new Horde_Imap_Client_Search_Query();
- $search->sequence($ids, $seq);
+ if (is_null($ids)) {
+ $search = null;
+ } else {
+ $search = new Horde_Imap_Client_Search_Query();
+ $search->sequence($ids, $seq);
+ }
$res = $this->search($this->_selected, $search, array('sort' => array(Horde_Imap_Client::SORT_ARRIVAL)));
$ret = array('uids' => $res['sort']);
if ($seq) {
* we will get VANISHED responses, so we need to do this. */
if ($use_cache && is_null($s_res)) {
/* Keys in $s_res['sort'] start at 0, not 1. */
- $s_res = $this->search($mailbox, null, array('sort' => array(Horde_Imap_Client::SORT_ARRIVAL)));
+ $s_res = $this->_getSeqUIDLookup(null, false);
+ $s_res['sort'] = $s_res['uids'];
}
$tmp = &$this->_temp;