Only show new messages if they match the current search (#1484176)
| | |
| | | - Added Georgian localization by Zaza Zviadadze |
| | | - Updated Russian localization |
| | | - Fixed some potential security risks (audited by Andris) |
| | | |
| | | - Only show new messages if they match the current search (#1484176) |
| | | |
| | | 2007/11/20 (tomekp) |
| | | ---------- |
| | |
| | | $mailbox = $this->mailbox; |
| | | |
| | | // count search set |
| | | if ($this->search_string && $mailbox == $this->mailbox && $mode == 'ALL') |
| | | if ($this->search_string && $mailbox == $this->mailbox && $mode == 'ALL' && !$force) |
| | | return count((array)$this->search_set); |
| | | |
| | | $a_mailbox_cache = $this->get_cache('messagecount'); |
| | |
| | | |
| | | return $this->get_search_set(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Check if the given message ID is part of the current search set |
| | | * |
| | | * @return True on match or if no search request is stored |
| | | */ |
| | | function in_searchset($msgid) |
| | | { |
| | | if (!empty($this->search_string)) |
| | | return in_array("$msgid", (array)$this->search_set, true); |
| | | else |
| | | return true; |
| | | } |
| | | |
| | | |
| | | /** |
| | |
| | | this.command('show'); |
| | | else if (list.key_pressed == list.DELETE_KEY) |
| | | this.command('delete'); |
| | | else |
| | | list.shiftkey = false; |
| | | }; |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | this.set_busy(true, 'checkingmail'); |
| | | this.http_request('check-recent', '_t='+(new Date().getTime()), true); |
| | | this.http_request('check-recent', (this.env.search_request ? '_search='+this.env.search_request+'&' : '') + '_t='+(new Date().getTime()), true); |
| | | }; |
| | | |
| | | |
| | |
| | | if (this.focused != true) |
| | | return true; |
| | | |
| | | this.shiftkey = e.shiftKey; |
| | | |
| | | var keyCode = document.layers ? e.which : document.all ? event.keyCode : document.getElementById ? e.keyCode : 0; |
| | | var mod_key = rcube_event.get_modifier(e); |
| | | switch (keyCode) |
| | |
| | | break; |
| | | |
| | | default: |
| | | this.shiftkey = e.shiftKey; |
| | | this.key_pressed = keyCode; |
| | | this.trigger_event('keypress'); |
| | | } |
| | |
| | | { |
| | | if ($recent_count = $IMAP->messagecount(NULL, 'RECENT', TRUE)) |
| | | { |
| | | $count = $IMAP->messagecount(NULL, 'ALL', TRUE); |
| | | // refresh saved search set |
| | | if (($search_request = get_input_value('_search', RCUBE_INPUT_GPC)) && $IMAP->search_set) |
| | | $_SESSION['search'][$search_request] = $IMAP->refresh_search(); |
| | | |
| | | $count_all = $IMAP->messagecount(NULL, 'ALL', TRUE); |
| | | $unread_count = $IMAP->messagecount(NULL, 'UNSEEN', TRUE); |
| | | |
| | | $OUTPUT->set_env('messagecount', $count); |
| | | $OUTPUT->set_env('messagecount', $IMAP->messagecount()); |
| | | $OUTPUT->command('set_unread_count', $mbox_name, $unread_count, true); |
| | | $OUTPUT->command('set_rowcount', rcmail_get_messagecount_text()); |
| | | $OUTPUT->command('set_quota', $IMAP->get_quota()); |
| | | |
| | | // add new message headers to list |
| | | $a_headers = array(); |
| | | for ($i=$recent_count, $id=$count-$recent_count+1; $i>0; $i--, $id++) |
| | | for ($i=$recent_count, $id=$count_all-$recent_count+1; $i>0; $i--, $id++) |
| | | { |
| | | // skip message if it does not match the current search |
| | | if (!$IMAP->in_searchset($id)) |
| | | continue; |
| | | |
| | | $header = $IMAP->get_headers($id, NULL, FALSE); |
| | | if ($header->recent) |
| | | $a_headers[] = $header; |
| | |
| | | $mbox_name = $IMAP->get_mailbox_name(); |
| | | |
| | | // fetch message headers |
| | | if ($count = $IMAP->messagecount($mbox_name, 'ALL', !empty($_REQUEST['_refresh']))) |
| | | if ($IMAP->messagecount($mbox_name, 'ALL', !empty($_REQUEST['_refresh']))) |
| | | $a_headers = $IMAP->list_headers($mbox_name, NULL, $sort_col, $sort_order); |
| | | |
| | | $count = $IMAP->messagecount($mbox_name); |
| | | $unseen = $IMAP->messagecount($mbox_name, 'UNSEEN', !empty($_REQUEST['_refresh'])); |
| | | |
| | | // update message count display |
| | |
| | | else |
| | | exit; |
| | | |
| | | // refresh saved seach set after moving some messages |
| | | // refresh saved search set after moving some messages |
| | | if (($search_request = get_input_value('_search', RCUBE_INPUT_GPC)) && $IMAP->search_set) |
| | | $_SESSION['search'][$search_request] = $IMAP->refresh_search(); |
| | | |