Changeset 1107480 in github


Ignore:
Timestamp:
Nov 25, 2007 3:40:10 PM (6 years ago)
Author:
thomascube <thomas@…>
Branches:
master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
Children:
ed54070
Parents:
d5342aa
Message:

Only show new messages if they match the current search (#1484176)

Files:
7 edited

Legend:

Unmodified
Added
Removed
  • CHANGELOG

    rc579961 r1107480  
    1313- Updated Russian localization 
    1414- Fixed some potential security risks (audited by Andris) 
    15  
     15- Only show new messages if they match the current search (#1484176) 
    1616 
    17172007/11/20 (tomekp) 
  • program/include/rcube_imap.inc

    rd5342aa r1107480  
    442442       
    443443    // count search set 
    444     if ($this->search_string && $mailbox == $this->mailbox && $mode == 'ALL') 
     444    if ($this->search_string && $mailbox == $this->mailbox && $mode == 'ALL' && !$force) 
    445445      return count((array)$this->search_set); 
    446446 
     
    935935    return $this->get_search_set(); 
    936936    } 
     937   
     938   
     939  /** 
     940   * Check if the given message ID is part of the current search set 
     941   * 
     942   * @return True on match or if no search request is stored 
     943   */ 
     944  function in_searchset($msgid) 
     945  { 
     946    if (!empty($this->search_string)) 
     947      return in_array("$msgid", (array)$this->search_set, true); 
     948    else 
     949      return true; 
     950  } 
    937951 
    938952 
  • program/js/app.js

    r0aa430a r1107480  
    11441144    else if (list.key_pressed == list.DELETE_KEY) 
    11451145      this.command('delete'); 
     1146    else 
     1147      list.shiftkey = false; 
    11461148    }; 
    11471149 
     
    34843486 
    34853487    this.set_busy(true, 'checkingmail'); 
    3486     this.http_request('check-recent', '_t='+(new Date().getTime()), true); 
     3488    this.http_request('check-recent', (this.env.search_request ? '_search='+this.env.search_request+'&' : '') + '_t='+(new Date().getTime()), true); 
    34873489    }; 
    34883490 
  • program/js/list.js

    ra9dda59 r1107480  
    536536    return true; 
    537537 
    538   this.shiftkey = e.shiftKey; 
    539  
    540538  var keyCode = document.layers ? e.which : document.all ? event.keyCode : document.getElementById ? e.keyCode : 0; 
    541539  var mod_key = rcube_event.get_modifier(e); 
     
    548546 
    549547    default: 
     548      this.shiftkey = e.shiftKey; 
    550549      this.key_pressed = keyCode; 
    551550      this.trigger_event('keypress'); 
  • program/steps/mail/check_recent.inc

    r5eee009 r1107480  
    2828    if ($recent_count = $IMAP->messagecount(NULL, 'RECENT', TRUE)) 
    2929      { 
    30       $count = $IMAP->messagecount(NULL, 'ALL', TRUE); 
     30      // refresh saved search set 
     31      if (($search_request = get_input_value('_search', RCUBE_INPUT_GPC)) && $IMAP->search_set) 
     32        $_SESSION['search'][$search_request] = $IMAP->refresh_search(); 
     33         
     34      $count_all = $IMAP->messagecount(NULL, 'ALL', TRUE); 
    3135      $unread_count = $IMAP->messagecount(NULL, 'UNSEEN', TRUE); 
    3236 
    33       $OUTPUT->set_env('messagecount', $count); 
     37      $OUTPUT->set_env('messagecount', $IMAP->messagecount()); 
    3438      $OUTPUT->command('set_unread_count', $mbox_name, $unread_count, true); 
    3539      $OUTPUT->command('set_rowcount', rcmail_get_messagecount_text()); 
     
    3842      // add new message headers to list 
    3943      $a_headers = array(); 
    40       for ($i=$recent_count, $id=$count-$recent_count+1; $i>0; $i--, $id++) 
     44      for ($i=$recent_count, $id=$count_all-$recent_count+1; $i>0; $i--, $id++) 
    4145        { 
     46        // skip message if it does not match the current search 
     47        if (!$IMAP->in_searchset($id)) 
     48          continue; 
     49         
    4250        $header = $IMAP->get_headers($id, NULL, FALSE); 
    4351        if ($header->recent) 
  • program/steps/mail/list.inc

    r5349b78 r1107480  
    4141 
    4242// fetch message headers 
    43 if ($count = $IMAP->messagecount($mbox_name, 'ALL', !empty($_REQUEST['_refresh']))) 
     43if ($IMAP->messagecount($mbox_name, 'ALL', !empty($_REQUEST['_refresh']))) 
    4444  $a_headers = $IMAP->list_headers($mbox_name, NULL, $sort_col, $sort_order); 
    4545 
     46$count = $IMAP->messagecount($mbox_name); 
    4647$unseen = $IMAP->messagecount($mbox_name, 'UNSEEN', !empty($_REQUEST['_refresh'])); 
    4748 
  • program/steps/mail/move_del.inc

    r9a3567a r1107480  
    6161  exit; 
    6262 
    63 // refresh saved seach set after moving some messages 
     63// refresh saved search set after moving some messages 
    6464if (($search_request = get_input_value('_search', RCUBE_INPUT_GPC)) && $IMAP->search_set) 
    6565  $_SESSION['search'][$search_request] = $IMAP->refresh_search(); 
Note: See TracChangeset for help on using the changeset viewer.