src/whatsprot.class.php
public function sendReceipt($node, $type = 'read', $participant = null, $callId = null)
    {
        $messageHash = [];
        if ($type == 'read') {
            $messageHash['type'] = $type;
        }
        if ($participant != null) {
            $messageHash['participant'] = $participant;
        }
        $messageHash['to'] = $node->getAttribute('from');
        $messageHash['id'] = $node->getAttribute('id');
        $messageHash['t'] = $node->getAttribute('t');

        if ($callId != null) {
            $offerNode = new ProtocolNode('offer', ['call-id' => $callId], null, null);
            $messageNode = new ProtocolNode('receipt', $messageHash, [$offerNode], null);
        } else {
            $messageNode = new ProtocolNode('receipt', $messageHash, null, null);
        }
        $this->sendNode($messageNode);
        $this->eventManager()->fire('onSendMessageReceived',
            [
                $this->phoneNumber,
                $node->getAttribute('id'),
                $node->getAttribute('from'),
                $type,
            ]);
    }
public function sendReceipt($node, $type = 'read', $participant = null, $callId = null)
    {
        $messageHash = [];
        if ($type == 'read') {
            $messageHash['type'] = $type;
        }
        if ($participant != null) {
            $messageHash['participant'] = $participant;
        }
        $messageHash['to'] = $node->getAttribute('from');
        $messageHash['id'] = $node->getAttribute('id');
        $messageHash['t'] = $node->getAttribute('t');

        if ($callId != null) {
            $offerNode = new ProtocolNode('offer', ['call-id' => $callId], null, null);
            $messageNode = new ProtocolNode('receipt', $messageHash, [$offerNode], null);
        } else {
            $messageNode = new ProtocolNode('receipt', $messageHash, null, null);
        }
        $this->sendNode($messageNode);
        $this->eventManager()->fire('onSendMessageReceived',
            [
                $this->phoneNumber,
                $node->getAttribute('id'),
                $node->getAttribute('from'),
                $type,
            ]);
    }
public function sendReceipt ( $ node , $ type = 'read' , $ participant = null , $ callId = null ) { $ messageHash = [ ] ; if ( $ type == 'read' ) { $ messageHash [ 'type' ] = $ type ; } if ( $ participant != null ) { $ messageHash [ 'participant' ] = $ participant ; } $ messageHash [ 'to' ] = $ node -> getAttribute ( 'from' ) ; $ messageHash [ 'id' ] = $ node -> getAttribute ( 'id' ) ; $ messageHash [ 't' ] = $ node -> getAttribute ( 't' ) ; if ( $ callId != null ) { $ offerNode = new ProtocolNode ( 'offer' , [ 'call-id' => $ callId ] , null , null ) ; $ messageNode = new ProtocolNode ( 'receipt' , $ messageHash , [ $ offerNode ] , null ) ; } else { $ messageNode = new ProtocolNode ( 'receipt' , $ messageHash , null , null ) ; } $ this -> sendNode ( $ messageNode ) ; $ this -> eventManager ( ) -> fire ( 'onSendMessageReceived' , [ $ this -> phoneNumber , $ node -> getAttribute ( 'id' ) , $ node -> getAttribute ( 'from' ) , $ type , ] ) ; }
Tell the server we received the message.

@param ProtocolNode $node        The ProtocolTreeNode that contains the message.
@param string       $type
@param string       $participant
@param string       $callId
Tell the server we received the message .