Ignore:
Timestamp:
09/22/08 17:02:02 (16 years ago)
Author:
niltonneto
Message:

Alterações feitas por Alexandre Correia.
Vide alterações 0.79 (Trac).
Email: alexandrecorreia@…

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/jabberit_messenger/inc/class.jabber.inc.php

    r382 r459  
    103103                        $this->SendPacket("<stream:stream to='{$this->server}' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0'>\n"); 
    104104 
    105                         sleep(2); 
     105                        sleep(1); 
    106106 
    107107                        if ($this->_check_connected()) 
     
    304304 
    305305 
    306  
    307306        function StripJID($jid = NULL) 
    308307        { 
     
    310309                return ($temp[1] != "") ? $temp[1] : $jid; 
    311310        } 
    312  
    313311 
    314312 
     
    383381                } 
    384382        } 
    385  
    386  
    387383 
    388384        function SendError($to, $id = NULL, $error_number, $error_message = NULL) 
     
    399395        } 
    400396 
    401  
     397        function RosterGroups() 
     398        { 
     399                $roster_request_id = "roster_" . time(); 
     400                $incoming_array = $this->SendIq(NULL, 'get', $roster_request_id, "jabber:iq:roster"); 
     401                $groups = array(); 
     402 
     403                if (is_array($incoming_array)) 
     404                { 
     405                        if ($incoming_array['iq']['@']['type'] == 'result' 
     406                                && $incoming_array['iq']['@']['id'] == $roster_request_id 
     407                                && $incoming_array['iq']['#']['query']['0']['@']['xmlns'] == "jabber:iq:roster") 
     408                        { 
     409                                $number_of_contacts = count($incoming_array['iq']['#']['query'][0]['#']['item']); 
     410                                $this->roster = array(); 
     411 
     412                                for ($a = 0; $a < $number_of_contacts; $a++) 
     413                                         $groups[] = $incoming_array['iq']['#']['query'][0]['#']['item'][$a]['#']['group'][0]['#']; 
     414 
     415                                return $groups; 
     416                        } 
     417                        else 
     418                        { 
     419                                $this->AddToLog("ERROR: RosterGroups() #1"); 
     420                                return FALSE; 
     421                        } 
     422                } 
     423                else 
     424                { 
     425                        $this->AddToLog("ERROR: RosterGroups() #2"); 
     426                        return FALSE; 
     427                } 
     428 
     429        } 
    402430 
    403431        function RosterUpdate() 
     
    9901018 
    9911019                $this->SendPacket("<starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>\n"); 
    992                 sleep(2); 
     1020                sleep(1); 
    9931021                $incoming_array = $this->_listen_incoming(); 
    9941022 
     
    10181046                $this->SendPacket("<?xml version='1.0' encoding='UTF-8' ?" . ">\n"); 
    10191047                $this->SendPacket("<stream:stream to='{$this->server}' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0'>\n"); 
    1020                 sleep(2); 
     1048                sleep(1); 
    10211049 
    10221050                if (!$this->_check_connected()) 
     
    17531781        } 
    17541782 
    1755  
    1756  
    17571783        function AddPacketDetails($string, $value = NULL) 
    17581784        { 
     
    17771803                eval("\$this->nodes$node = \"" . htmlspecialchars($value) . "\";"); 
    17781804        } 
    1779  
    1780  
    17811805 
    17821806        function BuildPacket($array = NULL) 
Note: See TracChangeset for help on using the changeset viewer.