Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F118392846
D1261.1775794769.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
2 KB
Referenced Files
None
Subscribers
None
D1261.1775794769.diff
View Options
diff --git a/plugins/libkolab/lib/kolab_storage_cache.php b/plugins/libkolab/lib/kolab_storage_cache.php
--- a/plugins/libkolab/lib/kolab_storage_cache.php
+++ b/plugins/libkolab/lib/kolab_storage_cache.php
@@ -646,28 +646,35 @@
else {
$filter = $this->_query2assoc($query);
- $this->imap_mode(true);
+ if ($filter['uid']) {
+ // We already know what we want (Maybe we will not know if we switch this around to using event uids)
+ $index = [$filter['uid']];
+ } else {
+ // Search for what we want
+ $this->imap_mode(true);
- if ($filter['type']) {
- $search = 'UNDELETED HEADER X-Kolab-Type ' . kolab_format::KTYPE_PREFIX . $filter['type'];
- $index = $this->imap->search_once($this->folder->name, $search);
- }
- else {
- $index = $this->imap->index($this->folder->name, null, null, true, true);
- }
+ if ($filter['type']) {
+ $search = 'UNDELETED HEADER X-Kolab-Type ' . kolab_format::KTYPE_PREFIX . $filter['type'];
+ $index = $this->imap->search_once($this->folder->name, $search);
+ }
+ else {
+ $index = $this->imap->index($this->folder->name, null, null, true, true);
+ }
- $this->imap_mode(false);
+ $this->imap_mode(false);
- if ($index->is_error()) {
- $this->check_error();
- if ($uids) {
- return null;
+ if ($index->is_error()) {
+ $this->check_error();
+ if ($uids) {
+ return null;
+ }
+ $result->set_error(true);
+ return $result;
}
- $result->set_error(true);
- return $result;
- }
- $index = $index->get();
+ // Results come in the wrong order by default
+ $index = array_reverse($index->get());
+ }
$result = $uids ? $index : $this->_fetch($index, $filter['type']);
// TODO: post-filter result according to query
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Apr 10, 4:19 AM (12 h, 40 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18794157
Default Alt Text
D1261.1775794769.diff (2 KB)
Attached To
Mode
D1261: Support IMAP lookup by uid
Attached
Detach File
Event Timeline