summaryrefslogtreecommitdiff
path: root/program/lib/imap.inc
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2008-11-14 11:18:00 +0000
committeralecpl <alec@alec.pl>2008-11-14 11:18:00 +0000
commit697cc52cff43176edb809a0cba723ca4a27ba47d (patch)
tree36b7960df414e8f3cdd35e1ef1cefb6665adcad5 /program/lib/imap.inc
parent8abda59ce499bc0a68c15e225cae6df9702457f5 (diff)
- fixes for status filter
- don't call search second time if first call returns empty (array) result
Diffstat (limited to 'program/lib/imap.inc')
-rw-r--r--program/lib/imap.inc10
1 files changed, 6 insertions, 4 deletions
diff --git a/program/lib/imap.inc b/program/lib/imap.inc
index 8cbb0e02b..8704e78f5 100644
--- a/program/lib/imap.inc
+++ b/program/lib/imap.inc
@@ -941,9 +941,11 @@ function iil_C_Sort(&$conn, $mailbox, $field, $add='', $is_uid=FALSE,
}
} while (!iil_StartsWith($line, 's ', true));
- if (empty($data)) {
- $conn->error = $line;
- return false;
+ $result_code = iil_ParseResult($line);
+
+ if ($result_code != 0) {
+ $conn->error = 'iil_C_Sort: ' . $line . "\n";
+ return false;
}
$out = explode(' ',$data);
@@ -2116,7 +2118,7 @@ function iil_C_Search(&$conn, $folder, $criteria) {
$messages = explode(' ', $str);
}
} while (!iil_StartsWith($line, 'srch1', true));
-
+
$result_code = iil_ParseResult($line);
if ($result_code == 0) {
return $messages;