src/whatsprot.class.php
protected function processProfilePicture($node)
    {
        $pictureNode = $node->getChild('picture');

        if ($pictureNode != null) {
            if ($pictureNode->getAttribute('type') == 'preview') {
                $filename = $this->dataFolder.Constants::PICTURES_FOLDER.DIRECTORY_SEPARATOR.'preview_'.$node->getAttribute('from').'jpg';
            } else {
                $filename = $this->dataFolder.Constants::PICTURES_FOLDER.DIRECTORY_SEPARATOR.$node->getAttribute('from').'.jpg';
            }

            file_put_contents($filename, $pictureNode->getData());
        }
    }
protected function processProfilePicture($node)
    {
        $pictureNode = $node->getChild('picture');

        if ($pictureNode != null) {
            if ($pictureNode->getAttribute('type') == 'preview') {
                $filename = $this->dataFolder.Constants::PICTURES_FOLDER.DIRECTORY_SEPARATOR.'preview_'.$node->getAttribute('from').'jpg';
            } else {
                $filename = $this->dataFolder.Constants::PICTURES_FOLDER.DIRECTORY_SEPARATOR.$node->getAttribute('from').'.jpg';
            }

            file_put_contents($filename, $pictureNode->getData());
        }
    }
protected function processProfilePicture ( $ node ) { $ pictureNode = $ node -> getChild ( 'picture' ) ; if ( $ pictureNode != null ) { if ( $ pictureNode -> getAttribute ( 'type' ) == 'preview' ) { $ filename = $ this -> dataFolder . Constants :: PICTURES_FOLDER . DIRECTORY_SEPARATOR . 'preview_' . $ node -> getAttribute ( 'from' ) . 'jpg' ; } else { $ filename = $ this -> dataFolder . Constants :: PICTURES_FOLDER . DIRECTORY_SEPARATOR . $ node -> getAttribute ( 'from' ) . '.jpg' ; } file_put_contents ( $ filename , $ pictureNode -> getData ( ) ) ; } }
Processes received picture node.

@param ProtocolNode $node ProtocolNode containing the picture
Processes received picture node .