Ignore:
Timestamp:
05/26/08 11:45:16 (16 years ago)
Author:
niltonneto
Message:

Verificar Wiki/Trac? do módulo.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/instant_messenger/inc/class.Ujabber.inc.php

    r275 r287  
    77        private $set_presence; 
    88         
    9         public final function __construct() 
     9        public final function __construct($pConnectionType = 'write') 
    1010        {        
    1111                session_start(); 
    12  
    1312                $this->_user     = $_SESSION['phpgw_info']['instant_messenger']['user']; 
    1413                $this->_pass     = $_SESSION['phpgw_info']['instant_messenger']['passwd']; 
     
    1716                $this->_resource = $_SESSION['phpgw_info']['instant_messenger']['resource_jabber']; 
    1817                $webjabber       = $_SESSION['phpgw_info']['instant_messenger']['webjabber']; 
    19  
    2018                session_write_close(); 
    2119 
    22                 if ( $this->connect($this->_user . '@' . $this->_server . '/' . $this->_resource . ':' . $this->_port, $this->_pass, 'read/write', $webjabber) ) 
     20                if ( $this->connect($this->_user . '@' . $this->_server . '/' . $this->_resource . ':' . $this->_port, $this->_pass, $pConnectionType, $webjabber) ) 
    2321                        $this->connected = true; 
    2422                else 
     
    6159                        while ( ( connection_aborted() === 0 ) && time() - $init < 50 ) 
    6260                        { 
    63                                  
     61                                if( isset($xml) )        
     62                                        unset($xml); 
     63                         
    6464                                # read from server and write in the client 
    6565                                $xml = $this->readSocket(); 
    66                                 //var_dump($xml); 
    6766                                $xml = ( strlen($xml) ) ? $xml : ' '; 
     67                                //$xml = ( strlen($xml) ) ? $xml : '_##_'; 
    6868                                printf("%s", $xml); 
    6969                                ob_flush(); 
     
    7474        } 
    7575 
    76     public final function SendMessage($pSendMessage) 
    77     { 
     76        public final function SendMessage($pSendMessage) 
     77        { 
    7878                if ( !$this->isConnected() ) 
    7979                        return "disconnected"; 
     
    8585                $pSendMessage['body'] = preg_replace($patterns, $replace, $pSendMessage['body']); 
    8686 
    87                 $_emotions  = '/<img emotion="(\S+)?"[^>]+>/'; 
     87                $_emotions  = '/<img[^>]*emotion="(\S+)?"[^>]*>/';  
    8888                $_emotions = preg_match_all($_emotions, $pSendMessage['body'], $emotions); 
    8989 
     
    134134 
    135135                        //retirar a linha abaixo para voltar ao padrão conforme acima 
    136                         $xml .= "<body>" . $content['body'] . "</body>"; 
     136                        $xml .= "<body><![CDATA[" . htmlentities($content['body']) . "]]></body>"; 
    137137                        $xml .= $payload; 
    138138                        $xml .= "</message>"; 
Note: See TracChangeset for help on using the changeset viewer.