public function connectAndLogin()
    {
        if(!$this->connected)
        {
            $account = $this->config["default"];

            $this->whatsProt->connect();
            $this->whatsProt->loginWithPassword($this->password);
            $this->whatsProt->sendGetClientConfig();
            $this->whatsProt->sendGetServerProperties();
            $this->whatsProt->sendGetGroups();
            $this->whatsProt->sendGetBroadcastLists();
            $this->whatsProt->sendGetPrivacyBlockedList();
            $this->whatsProt->sendAvailableForChat($this->config["accounts"][$account]['nickname']);
            $this->connected = true;
        }
    }
public function connectAndLogin()
    {
        if(!$this->connected)
        {
            $account = $this->config["default"];

            $this->whatsProt->connect();
            $this->whatsProt->loginWithPassword($this->password);
            $this->whatsProt->sendGetClientConfig();
            $this->whatsProt->sendGetServerProperties();
            $this->whatsProt->sendGetGroups();
            $this->whatsProt->sendGetBroadcastLists();
            $this->whatsProt->sendGetPrivacyBlockedList();
            $this->whatsProt->sendAvailableForChat($this->config["accounts"][$account]['nickname']);
            $this->connected = true;
        }
    }
public function connectAndLogin ( ) { if ( ! $ this -> connected ) { $ account = $ this -> config [ "default" ] ; $ this -> whatsProt -> connect ( ) ; $ this -> whatsProt -> loginWithPassword ( $ this -> password ) ; $ this -> whatsProt -> sendGetClientConfig ( ) ; $ this -> whatsProt -> sendGetServerProperties ( ) ; $ this -> whatsProt -> sendGetGroups ( ) ; $ this -> whatsProt -> sendGetBroadcastLists ( ) ; $ this -> whatsProt -> sendGetPrivacyBlockedList ( ) ; $ this -> whatsProt -> sendAvailableForChat ( $ this -> config [ "accounts" ] [ $ account ] [ 'nickname' ] ) ; $ this -> connected = true ; } }
Connect to Whatsapp server and Login

@return void
Connect to Whatsapp server and Login