diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2017-05-15 18:23:06 +0300 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2017-05-15 18:23:06 +0300 |
commit | 46be5f3f294d06b311921d6b1c494922686b2627 (patch) | |
tree | 7d42d244ed584daf900b7f0d26ec6197d938ea6c /lib/Mailbox.php | |
parent | 77f161cc49c262e27e76ee1fab34de438f78305c (diff) |
Only limit search to cursor time if it's actually set
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'lib/Mailbox.php')
-rw-r--r-- | lib/Mailbox.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Mailbox.php b/lib/Mailbox.php index 4dde6514d..0db17b06d 100644 --- a/lib/Mailbox.php +++ b/lib/Mailbox.php @@ -107,7 +107,9 @@ class Mailbox implements IMailBox { if ($this->getSpecialRole() !== 'trash') { $query->flag(Horde_Imap_Client::FLAG_DELETED, false); } - $query->dateSearch($cursor, Horde_Imap_Client_Search_Query::DATE_SINCE); + if (!is_null($cursor)) { + $query->dateSearch($cursor, Horde_Imap_Client_Search_Query::DATE_SINCE); + } try { $result = $this->conn->search($this->mailBox, $query, [ @@ -119,7 +121,7 @@ class Mailbox implements IMailBox { // maybe the server's advertisment of SORT was a fake // see https://github.com/nextcloud/mail/issues/50 // try again without SORT - return $this->getFetchIds(); + return $this->getFetchIds($cursor); } return array_reverse($result['match']->ids); |