Skip to content
This repository has been archived by the owner on Nov 8, 2018. It is now read-only.

Commit

Permalink
use search strategy only if SORT is not supported
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristophWurst committed Jun 16, 2016
1 parent b76a3a6 commit 8498a52
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/mailbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ private function getFetchIds($from, $count) {
$q = new Horde_Imap_Client_Fetch_Query();
$q->uid();
$q->imapDate();
// FIXME: $q->headers('DATE', ['DATE']); could be a better option than the INTERNALDATE

$result = $this->conn->fetch($this->mailBox, $q);
$uidMap = [];
Expand All @@ -132,7 +131,7 @@ private function getFetchIds($from, $count) {
}

public function getMessages($from = 0, $count = 2, $filter = '') {
if (is_null($filter) || $filter === '') {
if (!$this->conn->capability->query('SORT') && (is_null($filter) || $filter === '')) {
$ids = $this->getFetchIds($from, $count);
} else {
$ids = $this->getSearchIds($from, $count, $filter);
Expand Down

0 comments on commit 8498a52

Please sign in to comment.