Ignore:
Timestamp:
06/02/12 16:40:08 (12 years ago)
Author:
airton
Message:

Ticket #2830 - Inconsistencia ao aplicar filtro nas mensagens da caixa de entrada

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/prototype/modules/filters/interceptors/FilterMapping.php

    r6377 r6392  
    5858{ 
    5959        var $service; 
    60          
     60        var $msgs_apply = array(); 
    6161        /** 
    6262        * Método que cria o ID da regra que está sendo criada. 
     
    282282                { 
    283283                  $script_rules .= "vacation" . $vacation_action . "\r\n"; 
     284                } 
     285 
     286                foreach ($rules as &$values) {                                           
     287                        if($values['applyMessages']) 
     288                                $this->msgs_apply[] = $values['applyMessages']; 
     289                        $values['applyMessages'] = array(); 
    284290                } 
    285291 
     
    501507                        $this->rules = array(); 
    502508                } 
    503                  
    504509                return( $this->rules ); 
    505510        } 
     
    522527        public function applySieveFilter( &$uri , &$result , &$criteria , $original  ) 
    523528        { 
     529                $rule_apply = array();  
     530                         
     531                $filter = Controller::read($uri); 
     532                $filter_ = $this->parseSieveScript($filter['content']); 
    524533                 
    525                 //if()                   
    526                 //{                                              
    527                         $rule_apply = array();  
     534                foreach ($filter_ as $f_) { 
     535                        if($f_['id'] == $uri['id']) {  
     536                                $rule_apply     = $f_; 
     537                        } 
     538                } 
     539                                 
     540                $actions = array(); 
     541                $actions['type'] = $rule_apply['actions'][0]['type']; 
     542                $actions['parameter'] = $rule_apply['actions'][0]['parameter']; 
     543                /* Hardcoded */ 
     544                $actions['keep'] = false; 
     545 
     546                //$messages = $rule_apply['applyMessages']; 
     547                $messages = $this->msgs_apply[0]; 
     548                $this->msgs_apply = array(); 
    528549                         
    529                         $filter = Controller::read($uri); 
    530                         $filter_ = $this->parseSieveScript($filter['content']); 
    531                          
    532                         foreach ($filter_ as $f_) { 
    533                                 if($f_['id'] == $uri['id']) {  
    534                                         $rule_apply     = $f_; 
    535                                 } 
    536                         } 
    537                                          
    538                         $actions = array(); 
    539                         $actions['type']      = $rule_apply['actions'][0]['type']; 
    540                         $actions['parameter'] = $rule_apply['actions'][0]['parameter']; 
    541                         /* Hardcoded */ 
    542                         $actions['keep']      = false; 
    543  
    544                         $messages_to_apply = array();                    
    545  
    546                         $messages = $rule_apply['applyMessages']; 
    547                         /*         
    548                         $proc = array(); 
    549                         $proc['keep'] = false; 
    550                                   
    551                         */ 
    552                         $imap = Controller::service( 'Imap' ); 
    553                         $imap->apliSieveFilter($messages, $actions);  
    554                         return $result; 
    555                 //} 
     550                $imap = Controller::service( 'Imap' ); 
     551                $imap->apliSieveFilter($messages, $actions);  
     552                return $result; 
    556553        } 
    557554 
     
    596593        { 
    597594                if( !$this->rules ) 
    598                 $this->rules = $this->getRules(); 
     595                        $this->rules = $this->getRules(); 
    599596 
    600597            $uri['id'] = $params['id'] = isset($params['id']) ? $params['id'] : urlencode($params['name']); 
     
    633630                $params['id'] = $uri['id']; 
    634631 
    635                 $update = false; 
    636                  
    637632                $rules = array(); 
    638633 
Note: See TracChangeset for help on using the changeset viewer.