Ignore:
Timestamp:
06/17/08 14:44:24 (16 years ago)
Author:
niltonneto
Message:

Commit feito pelo desenvolvedor (rodrigosouza).

File:
1 edited

Legend:

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

    r311 r318  
    77        public final function __construct($pConnectionType = 'write') 
    88        { 
    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  
    249                try 
    2510                { 
     
    2914                        require_once dirname(__FILE__) . '/../instant_messenger.define.php'; 
    3015 
    31                         if ( !(defined('JABBER_URL') && defined('JABBER_RESOURCE')) ) 
     16                        if ( !(defined('IM_NAME_JABBER') && defined('IM_RESOURCE_JABBER')) ) 
    3217                                throw new Exception(__CLASS__ . '[ ERROR #2 ] : Jabber server is not cofigured'); 
    3318 
    34                         if ( !(defined('WEBJABBER_URL') && defined('WEBJABBER_PORT')) ) 
    35                                 throw new Exception(__CLASS__ . '[ ERROR #3 ] : Webabber 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'); 
    4126 
    4227                        session_start(); 
     
    4833 
    4934                        $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')) ) 
    5136                                $this->connected = true; 
    5237                } 
     
    121106        } 
    122107 
     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 
    123124        public final function SendMessage($pSendMessage) 
    124125        { 
     
    186187                        unset($id); 
    187188 
    188                         echo $xml; 
     189                        //echo $xml; 
    189190                        $this->writeSocket($xml); 
    190191                        $this->close(); 
Note: See TracChangeset for help on using the changeset viewer.