Changeset 287 for trunk/instant_messenger/inc/class.Ujabber.inc.php
- Timestamp:
- 05/26/08 11:45:16 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/instant_messenger/inc/class.Ujabber.inc.php
r275 r287 7 7 private $set_presence; 8 8 9 public final function __construct( )9 public final function __construct($pConnectionType = 'write') 10 10 { 11 11 session_start(); 12 13 12 $this->_user = $_SESSION['phpgw_info']['instant_messenger']['user']; 14 13 $this->_pass = $_SESSION['phpgw_info']['instant_messenger']['passwd']; … … 17 16 $this->_resource = $_SESSION['phpgw_info']['instant_messenger']['resource_jabber']; 18 17 $webjabber = $_SESSION['phpgw_info']['instant_messenger']['webjabber']; 19 20 18 session_write_close(); 21 19 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) ) 23 21 $this->connected = true; 24 22 else … … 61 59 while ( ( connection_aborted() === 0 ) && time() - $init < 50 ) 62 60 { 63 61 if( isset($xml) ) 62 unset($xml); 63 64 64 # read from server and write in the client 65 65 $xml = $this->readSocket(); 66 //var_dump($xml);67 66 $xml = ( strlen($xml) ) ? $xml : ' '; 67 //$xml = ( strlen($xml) ) ? $xml : '_##_'; 68 68 printf("%s", $xml); 69 69 ob_flush(); … … 74 74 } 75 75 76 77 76 public final function SendMessage($pSendMessage) 77 { 78 78 if ( !$this->isConnected() ) 79 79 return "disconnected"; … … 85 85 $pSendMessage['body'] = preg_replace($patterns, $replace, $pSendMessage['body']); 86 86 87 $_emotions = '/<img emotion="(\S+)?"[^>]+>/'; 87 $_emotions = '/<img[^>]*emotion="(\S+)?"[^>]*>/'; 88 88 $_emotions = preg_match_all($_emotions, $pSendMessage['body'], $emotions); 89 89 … … 134 134 135 135 //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>"; 137 137 $xml .= $payload; 138 138 $xml .= "</message>";
Note: See TracChangeset
for help on using the changeset viewer.