src/whatsprot.class.php
public function sendSetPrivacySettings($category, $value)
    {
        $msgId = $this->createIqId();
        $categoryNode = new ProtocolNode('category',
            [
                'name'  => $category,
                'value' => $value,
            ], null, null);

        $privacyNode = new ProtocolNode('privacy', null, [$categoryNode], null);
        $node = new ProtocolNode('iq',
            [
                'to'    => Constants::WHATSAPP_SERVER,
                'type'  => 'set',
                'id'    => $msgId,
                'xmlns' => 'privacy',
            ], [$privacyNode], null);

        $this->sendNode($node);
    }
public function sendSetPrivacySettings($category, $value)
    {
        $msgId = $this->createIqId();
        $categoryNode = new ProtocolNode('category',
            [
                'name'  => $category,
                'value' => $value,
            ], null, null);

        $privacyNode = new ProtocolNode('privacy', null, [$categoryNode], null);
        $node = new ProtocolNode('iq',
            [
                'to'    => Constants::WHATSAPP_SERVER,
                'type'  => 'set',
                'id'    => $msgId,
                'xmlns' => 'privacy',
            ], [$privacyNode], null);

        $this->sendNode($node);
    }
public function sendSetPrivacySettings ( $ category , $ value ) { $ msgId = $ this -> createIqId ( ) ; $ categoryNode = new ProtocolNode ( 'category' , [ 'name' => $ category , 'value' => $ value , ] , null , null ) ; $ privacyNode = new ProtocolNode ( 'privacy' , null , [ $ categoryNode ] , null ) ; $ node = new ProtocolNode ( 'iq' , [ 'to' => Constants :: WHATSAPP_SERVER , 'type' => 'set' , 'id' => $ msgId , 'xmlns' => 'privacy' , ] , [ $ privacyNode ] , null ) ; $ this -> sendNode ( $ node ) ; }
Set privacy of 'last seen', status or profile picture to all, contacts or none.

@param string $category
Options: 'last', 'status' or 'profile'
@param string $value
Options: 'all', 'contacts' or 'none'
Set privacy of last seen status or profile picture to all contacts or none .