summaryrefslogtreecommitdiff
path: root/program/include
diff options
context:
space:
mode:
authorThomas Bruederli <thomas@roundcube.net>2014-04-08 09:14:05 +0200
committerThomas Bruederli <thomas@roundcube.net>2014-04-08 09:14:05 +0200
commit0f48e6e660cb5aa0d7bfdf11967b648c78cb64f9 (patch)
tree573fe83e152cd4971c7fafea8887bf9f4e0f911c /program/include
parent0ccef59cfa1bf4b87fe616d94abab59f10d6717a (diff)
Fix message UID extraction for _uid=*; update unread count for all affected mailboxes
Diffstat (limited to 'program/include')
-rw-r--r--program/include/rcmail.php23
1 files changed, 17 insertions, 6 deletions
diff --git a/program/include/rcmail.php b/program/include/rcmail.php
index 952e8a5f2..87cf99237 100644
--- a/program/include/rcmail.php
+++ b/program/include/rcmail.php
@@ -2029,13 +2029,24 @@ class rcmail extends rcube
return $uid;
}
- // create a per-folder UIDs array
$result = array();
- foreach (explode(',', $_uid) as $uid) {
- list($uid, $mbox) = explode('-', $uid, 2);
- if (empty($mbox))
- $mbox = $_mbox;
- $result[$mbox][] = $uid;
+
+ // special case: *
+ if ($_uid == '*' && is_object($_SESSION['search'][1]) && $_SESSION['search'][1]->multi) {
+ // extract the full list of UIDs per folder from the search set
+ foreach ($_SESSION['search'][1]->sets as $subset) {
+ $mbox = $subset->get_parameters('MAILBOX');
+ $result[$mbox] = $subset->get();
+ }
+ }
+ else {
+ // create a per-folder UIDs array
+ foreach (explode(',', $_uid) as $uid) {
+ list($uid, $mbox) = explode('-', $uid, 2);
+ if (empty($mbox))
+ $mbox = $_mbox;
+ $result[$mbox][] = $uid;
+ }
}
return $result;