Changeset 327 for trunk/instant_messenger/inc/class.Ujabber.inc.php
- Timestamp:
- 06/24/08 17:09:46 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/instant_messenger/inc/class.Ujabber.inc.php
r323 r327 59 59 return "disconnected"; 60 60 61 $this->get_last_access_user(); 62 61 63 if ( strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') ) 62 64 { … … 74 76 $buffer = ''; 75 77 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 78 88 # read from server and write in the client 79 89 $xml = $this->readSocket(); … … 104 114 } 105 115 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); 110 141 } 111 142
Note: See TracChangeset
for help on using the changeset viewer.