Exemplo n.º 1
0
 public function sendMessage($toNumber, $message)
 {
     $this->connectAndLogin();
     $this->simulateTypingStart($toNumber);
     $this->message->setFromName($this->client->getIdentity()->getNickname());
     $this->message->setTo($toNumber);
     $this->message->setBody($message);
     $this->simulateTypingEnd();
     // Sending message...
     $this->client->send($this->message);
 }
 protected function simulateTypingEnd()
 {
     // Sending paused notification (typing end)
     $this->chatState->setState(ChatState::STATE_PAUSED);
     $this->client->send($this->chatState);
 }
Exemplo n.º 3
0
 protected function sendReceipt(Client $client, NodeInterface $node)
 {
     $receipt = new Receipt();
     $receipt->setTo($node->getAttribute('from'));
     $receipt->setId($node->getAttribute('id'));
     $client->send($receipt);
     return $this;
 }