Ignore:
Timestamp:
06/24/08 17:09:46 (16 years ago)
Author:
niltonneto
Message:
 
File:
1 edited

Legend:

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

    r323 r327  
    5959                        return "disconnected"; 
    6060 
     61                $this->get_last_access_user(); 
     62 
    6163                if ( strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') ) 
    6264                { 
     
    7476                        $buffer = ''; 
    7577 
    76                         while ( ( connection_aborted() === 0 ) && time() - $init < 50 ) 
    77                         { 
     78                        $send_last_access = time(); 
     79 
     80                        while ( (connection_aborted() === 0) && (time() - $init < 50) ) 
     81                        { 
     82                                if ( (time() - $send_last_access) > 15 ) 
     83                                { 
     84                                        $this->get_last_access_user(); 
     85                                        $send_last_access = time(); 
     86                                } 
     87 
    7888                                # read from server and write in the client 
    7989                                $xml = $this->readSocket(); 
     
    104114        } 
    105115 
    106         public final function checkConnection() 
    107         { 
    108                 $this->get_last_access_user(); 
    109                 return $this->isConnected(); 
     116        public final function update() 
     117        { 
     118                $presence = $_COOKIE['IM_presence']; 
     119 
     120                if ( !$presence ) 
     121                        $presence = 'available'; 
     122 
     123                switch ( $presence ) 
     124                { 
     125                        case 'away': 
     126                        case 'dnd': 
     127                        case 'xa': 
     128                                $presence = array('show' => $presence); 
     129                        break; 
     130                        case 'available': 
     131                        case 'unavailable': 
     132                                $presence = array('type' => $presence); 
     133                        break; 
     134                } 
     135 
     136                $this->getContacts(); 
     137                $this->setPresence(array('type'=>'unavailable')); 
     138                $this->setPresence($presence); 
     139 
     140                print_r($presence); 
    110141        } 
    111142 
Note: See TracChangeset for help on using the changeset viewer.