diff options
Diffstat (limited to 'program/steps/mail/check_recent.inc')
-rw-r--r-- | program/steps/mail/check_recent.inc | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/program/steps/mail/check_recent.inc b/program/steps/mail/check_recent.inc index 8c0b1ffc0..60da68a96 100644 --- a/program/steps/mail/check_recent.inc +++ b/program/steps/mail/check_recent.inc @@ -65,7 +65,7 @@ foreach ($a_mailboxes as $mbox_name) { if ($status && $is_current) { // refresh saved search set - $search_request = get_input_value('_search', RCUBE_INPUT_GPC); + $search_request = rcube_utils::get_input_value('_search', rcube_utils::INPUT_GPC); if ($search_request && isset($_SESSION['search']) && $_SESSION['search_request'] == $search_request ) { @@ -73,7 +73,7 @@ foreach ($a_mailboxes as $mbox_name) { } if (!empty($_GET['_quota'])) - $OUTPUT->command('set_quota', rcmail_quota_content()); + $OUTPUT->command('set_quota', $RCMAIL->quota_content()); $OUTPUT->set_env('exists', $RCMAIL->storage->count($mbox_name, 'EXISTS')); @@ -114,6 +114,24 @@ foreach ($a_mailboxes as $mbox_name) { $OUTPUT->command('update_selection'); } } + // handle flag updates + else if ($is_current && ($uids = rcube_utils::get_input_value('_uids', rcube_utils::INPUT_GPC))) { + $data = $RCMAIL->storage->folder_data($mbox_name); + + if (empty($_SESSION['list_mod_seq']) || $_SESSION['list_mod_seq'] != $data['HIGHESTMODSEQ']) { + $flags = $RCMAIL->storage->list_flags($mbox_name, explode(',', $uids), $_SESSION['list_mod_seq']); + foreach ($flags as $idx => $row) { + $flags[$idx] = array_change_key_case(array_map('intval', $row)); + } + + // remember last HIGHESTMODSEQ value (if supported) + if (!empty($data['HIGHESTMODSEQ'])) { + $_SESSION['list_mod_seq'] = $data['HIGHESTMODSEQ']; + } + + $RCMAIL->output->set_env('recent_flags', $flags); + } + } } // trigger refresh hook |