Ignore:
Timestamp:
11/08/11 15:30:53 (12 years ago)
Author:
wmerlotto
Message:

Ticket #2305 - Enviando alteracoes, desenvolvidas internamente na Prognus. Ultimas sincronizacoes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/expressoMail1_2/inc/class.imap_functions.inc.php

    r5134 r5158  
    17591759                $image['cid'] = eregi_replace("<", "", $image['cid']); 
    17601760                $image['cid'] = eregi_replace(">", "", $image['cid']); 
    1761                                 //if is Draft Ticket #1256 
    1762                                 $image['cid'] = str_replace("@localhost", "@prognus.org", $image['cid']); 
    1763                                 $body = eregi_replace("<br/>", "", $body); 
    17641761                                 
    17651762                $body = str_replace("src=\"cid:".$image['cid']."\"", " src=\"./inc/get_archive.php?msgFolder=$msg_folder&msgNumber=$msgno&indexPart=".$image['pid']."\" ", $body); 
     
    20912088                $msgs_in_the_server = $this->get_msgs($folder, $sort_box_type, $search_box_type, $sort_box_reverse,$msg_range_begin,$msg_range_end); 
    20922089                $msgs_in_the_server = array_keys($msgs_in_the_server); 
    2093                 if(!count($msgs_in_the_server)) 
    2094                         return array(); 
    2095  
     2090 
     2091                $num_msgs = (count($msgs_in_the_server) - imap_num_recent($this->mbox)); 
     2092 
     2093                $dif = ($params['msg_range_end'] - $params['msg_range_begin']) +1; 
     2094                if(!count($msgs_in_the_server)){ 
     2095                        $msg_range_begin -= $dif; 
     2096                        $msg_range_end -= $dif; 
     2097                        $msgs_in_the_server = $this->get_msgs($folder, $sort_box_type, $search_box_type, $sort_box_reverse,$msg_range_begin,$msg_range_end); 
     2098                        $msgs_in_the_server = array_keys($msgs_in_the_server);   
     2099                        $num_msgs = NULL; 
     2100                        $return['msg_range_begin'] = $msg_range_begin; 
     2101                        $return['msg_range_end'] = $msg_range_end; 
     2102                }                
    20962103                $return['new_msgs'] = imap_num_recent($this->mbox); 
    2097                 $num_msgs = (count($msgs_in_the_server) - imap_num_recent($this->mbox)); 
    2098  
     2104                 
    20992105                $msgs_in_the_client = explode(",", $msgs_existent); 
    21002106 
     
    21172123                                $aux++; 
    21182124                        } 
    2119                 }else if($num_msgs < $msg_range_end && $return['new_msgs'] == 0 && count($msg_to_insert) > 0){ 
     2125                }else if($num_msgs < $msg_range_end && $return['new_msgs'] == 0 && count($msg_to_insert) > 0 && $msg_range_end == $dif){ 
    21202126                        $return['tot_msgs'] = $num_msgs; 
    21212127                } 
    21222128                 
     2129                if(!count($msgs_in_the_server)){ 
     2130                        return Array(); 
     2131                }        
     2132 
    21232133                $msg_to_delete = array_diff($msgs_in_the_client, $msgs_in_the_server); 
    21242134                $msgs_to_exec = array(); 
     
    32173227        {                
    32183228                        $cid = base_convert(microtime().$j, 10, 36); //Gera um cid 
    3219                         $body = str_replace($cid_imgs[1][$j], '"cid:'.$cid.'@'.$_SESSION['phpgw_info']['expressomail']['server']['domain_name'].'"', $body ); //tira o src da imagem e coloca o cid, ele e concatenado com o domain do servidor por que a biblioteaca mime faz isso na hora de gerar o mime. 
     3229                        $body = str_replace($cid_imgs[1][$j], '"cid:'.$cid.'"', $body ); //tira o src da imagem e coloca o cid. 
    32203230                        $count    = strlen($cid_imgs[6][$j]); 
    32213231                                         
Note: See TracChangeset for help on using the changeset viewer.