Changeset 3401


Ignore:
Timestamp:
10/22/10 14:53:04 (14 years ago)
Author:
eduardoalex
Message:

Ticket #1220 - Corrigido o erro na pesquisa de mensagens importantes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2/expressoMail1_2/inc/class.imap_functions.inc.php

    r3399 r3401  
    33643364                                else { 
    33653365                                        $search_criteria = imap_search($mbox_stream, $filter, SE_UID); 
     3366                                         
     3367                        if((!strpos($filter,"FLAGGED") === false) || (!strpos($filter,"UNFLAGGED") === false)) 
     3368                                        { 
     3369                                $num_msgs = imap_num_msg($mbox_stream); 
     3370                                                $flagged_msgs = array(); 
     3371                                                for ($i=$num_msgs; $i>0; $i--) 
     3372                                                {                                                                
     3373                                                        $iuid = @imap_uid($this->mbox,$i); 
     3374                                                        $header = $this->get_header($iuid);                                                              
     3375                                                        if(trim($header->Flagged)) 
     3376                                                        { 
     3377                                                                $flagged_msgs[$i] = $iuid; 
     3378                                                        } 
     3379                                                } 
     3380                                                if((count($flagged_msgs) >0) && (strpos($filter,"UNFLAGGED") === false)) 
     3381                                                { 
     3382                                                        $arry_diff = array_diff($flagged_msgs,$search_criteria); 
     3383                                                        foreach($arry_diff as $msg) 
     3384                                                        { 
     3385                                                                $search_criteria[] = $msg; 
     3386                                                        } 
     3387                                                } 
     3388                                                else if((count($flagged_msgs) >0) && (is_array($search_criteria)) && (!strpos($filter,"UNFLAGGED") === false)) 
     3389                                                { 
     3390                                                        $search_criteria = array_diff($search_criteria,$flagged_msgs); 
     3391                                                } 
     3392                                        } 
    33663393                                        if( is_array( $search_criteria) ) 
    33673394                                        { 
Note: See TracChangeset for help on using the changeset viewer.