Changeset df0da2e0 in github


Ignore:
Timestamp:
Feb 2, 2008 2:41:32 PM (5 years ago)
Author:
thomascube <thomas@…>
Branches:
master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
Children:
adc3e41
Parents:
39508cb
Message:

Simplified fix for remembering searches when viewing message + Don't ask for MDN confirmations on drafted messages (#1484691)

Location:
program
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • program/include/rcube_imap.inc

    rfa0152c rdf0da2e0  
    762762 
    763763    $mailbox = $mbox_name ? $this->_mod_mailbox($mbox_name) : $this->mailbox; 
    764     $key = "$mbox:".$this->sort_field.":".$this->sort_order.".msgi"; 
     764    $key = "{$mailbox}:{$this->sort_field}:{$this->sort_order}:{$this->search_string}.msgi"; 
     765 
     766    // we have a saved search result. get index from there 
     767    if (!isset($this->cache[$key]) && $this->search_string && $mailbox == $this->mailbox) 
     768    { 
     769      $this->cache[$key] = $a_msg_headers = array(); 
     770      $this->_fetch_headers($mailbox, join(',', $this->search_set), $a_msg_headers, NULL); 
     771 
     772      foreach (iil_SortHeaders($a_msg_headers, $this->sort_field, $this->sort_order) as $i => $msg) 
     773        $this->cache[$key][] = $msg->uid; 
     774    } 
    765775 
    766776    // have stored it in RAM 
  • program/steps/mail/show.inc

    r1f020b5 rdf0da2e0  
    7575   
    7676  // check for unset disposition notification 
    77   if ($MESSAGE['headers']->mdn_to && !$MESSAGE['headers']->mdn_sent) 
     77  if ($MESSAGE['headers']->mdn_to && !$MESSAGE['headers']->mdn_sent && $IMAP->get_mailbox_name() != $CONFIG['drafts_mbox']) 
    7878  { 
    7979    rcube_add_label('mdnrequest'); 
     
    8181  } 
    8282 
    83   // set message set for search result 
    84   if (!empty($_REQUEST['_search']) && isset($_SESSION['search'][$_REQUEST['_search']])) 
    85     { 
    86     $IMAP->set_search_set($_SESSION['search'][$_REQUEST['_search']]); 
    87     $OUTPUT->set_env('search_request', $_REQUEST['_search']); 
    88     } 
    8983 
    9084  $next = $prev = $first = $last = -1; 
    9185  // get previous, first, next and last message UID 
    9286  if ((!($_SESSION['sort_col'] == 'date' && $_SESSION['sort_order'] == 'DESC') && 
    93       $IMAP->get_capability('sort') ) && !(!empty($_REQUEST['_search']) && 
    94       isset($_SESSION['search'][$_REQUEST['_search']])) ) 
     87      $IMAP->get_capability('sort')) || !empty($_REQUEST['_search'])) 
    9588    { 
    9689    // Only if we use custom sorting 
     
    10295    $next = isset($a_msg_index[$MESSAGE['index']+1]) ? $a_msg_index[$MESSAGE['index']+1] : -1 ; 
    10396    $last = count($a_msg_index)>0 ? $a_msg_index[count($a_msg_index)-1] : -1; 
    104     } 
    105   elseif (!empty($_REQUEST['_search']) && isset($_SESSION['search'][$_REQUEST['_search']])) 
    106     { 
    107       $search_data = $_SESSION['search'][$_REQUEST['_search']]; 
    108       $result = $IMAP->search(NULL, $search_data[0], $search_data[1],$search_data[3]); 
    109       $result = array_reverse($result); 
    110       foreach ($result as $key=>$rid) 
    111         { 
    112         $result[$key] = $IMAP->get_uid($rid); 
    113         if ($MESSAGE['UID'] == $result[$key]) 
    114           $seq = $key; 
    115         } 
    116       $prev = isset($result[$seq-1]) ? $result[$seq-1] : -1 ; 
    117       $first = count($result)>0 ? $result[0] : -1; 
    118       $next = isset($result[$seq+1]) ? $result[$seq+1] : -1 ; 
    119       $last = count($result)>0 ? $result[count($result)-1] : -1; 
    120       $MESSAGE['index'] = $seq; 
    12197    } 
    12298  else 
Note: See TracChangeset for help on using the changeset viewer.