summaryrefslogtreecommitdiff
path: root/roundcubemail/program/steps/mail/check_recent.inc
diff options
context:
space:
mode:
authorthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2007-11-25 20:40:10 +0000
committerthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2007-11-25 20:40:10 +0000
commit94cf2f11feeb8448995f83967f032768dd7c05df (patch)
treeba9d5bcd5cb19b3c64bec3b4172afe3a708db3cc /roundcubemail/program/steps/mail/check_recent.inc
parent902ec1456d958887bdc7ee4e1b5877a3c72db5b7 (diff)
Only show new messages if they match the current search (#1484176)
git-svn-id: https://svn.roundcube.net/trunk@932 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/steps/mail/check_recent.inc')
-rw-r--r--roundcubemail/program/steps/mail/check_recent.inc14
1 files changed, 11 insertions, 3 deletions
diff --git a/roundcubemail/program/steps/mail/check_recent.inc b/roundcubemail/program/steps/mail/check_recent.inc
index a2100f1d2..a392cd0e6 100644
--- a/roundcubemail/program/steps/mail/check_recent.inc
+++ b/roundcubemail/program/steps/mail/check_recent.inc
@@ -27,18 +27,26 @@ foreach ($a_mailboxes as $mbox_name)
{
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;