Changeset 318 for trunk/instant_messenger/inc/class.Ujabber.inc.php
- Timestamp:
- 06/17/08 14:44:24 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/instant_messenger/inc/class.Ujabber.inc.php
r311 r318 7 7 public final function __construct($pConnectionType = 'write') 8 8 { 9 /*session_start();10 11 $this->_user = $_SESSION['phpgw_info']['instant_messenger']['user'];12 //$this->_user = 'niltonneto';//$_SESSION['phpgw_info']['instant_messenger']['user'];13 //$this->_pass = 'nine59ever';//$_SESSION['phpgw_info']['instant_messenger']['passwd'];14 //$this->_pass = 'senha';//$_SESSION['phpgw_info']['instant_messenger']['passwd'];15 $this->_pass = $_SESSION['phpgw_info']['instant_messenger']['passwd'];16 $this->_server = $_SESSION['phpgw_info']['instant_messenger']['name_jabber'];17 $this->_port = '8883';//$_SESSION['phpgw_info']['instant_messenger']['port_jabber'];18 $this->_resource = $_SESSION['phpgw_info']['instant_messenger']['resource_jabber'];19 //$webjabber = 'im.pr.gov.br';//$_SESSION['phpgw_info']['instant_messenger']['webjabber'];20 $webjabber = '10.15.22.236';//$_SESSION['phpgw_info']['instant_messenger']['webjabber'];21 22 session_write_close();*/23 24 9 try 25 10 { … … 29 14 require_once dirname(__FILE__) . '/../instant_messenger.define.php'; 30 15 31 if ( !(defined(' JABBER_URL') && defined('JABBER_RESOURCE')) )16 if ( !(defined('IM_NAME_JABBER') && defined('IM_RESOURCE_JABBER')) ) 32 17 throw new Exception(__CLASS__ . '[ ERROR #2 ] : Jabber server is not cofigured'); 33 18 34 if ( !(defined(' WEBJABBER_URL') && defined('WEBJABBER_PORT')) )35 throw new Exception(__CLASS__ . '[ ERROR #3 ] : Web abber server is not cofigured');36 37 $this->_server = constant(' JABBER_URL');38 $this->_resource = constant(' JABBER_RESOURCE');39 40 $this->_port = constant(' WEBJABBER_PORT');19 if ( !(defined('IM_SERVER_WEBJABBER') && defined('IM_PORT_JABBER')) ) 20 throw new Exception(__CLASS__ . '[ ERROR #3 ] : Webjabber server is not cofigured'); 21 22 $this->_server = constant('IM_NAME_JABBER'); 23 $this->_resource = constant('IM_RESOURCE_JABBER'); 24 25 $this->_port = constant('IM_PORT_JABBER'); 41 26 42 27 session_start(); … … 48 33 49 34 $this->connected = false; 50 if ( $this->connect($access_string, $this->_pass, $pConnectionType, constant(' WEBJABBER_URL')) )35 if ( $this->connect($access_string, $this->_pass, $pConnectionType, constant('IM_SERVER_WEBJABBER')) ) 51 36 $this->connected = true; 52 37 } … … 121 106 } 122 107 108 public final function Composing($pJid) 109 { 110 $pJid = $pJid['jid']; 111 $id = 'chat' . "_" . time(); 112 $xml = "<message to='{$pJid}' type='chat' id='{$id}'><composing/></message>"; 113 $this->writeSocket($xml); 114 } 115 116 public final function Paused($pJid) 117 { 118 $pJid = $pJid['jid']; 119 $id = 'chat' . "_" . time(); 120 $xml = "<message to='{$pJid}' type='chat' id='{$id}'><paused/></message>"; 121 $this->writeSocket($xml); 122 } 123 123 124 public final function SendMessage($pSendMessage) 124 125 { … … 186 187 unset($id); 187 188 188 echo $xml;189 //echo $xml; 189 190 $this->writeSocket($xml); 190 191 $this->close();
Note: See TracChangeset
for help on using the changeset viewer.