Beispiel #1
0
 /**
  * @return Node
  */
 public function createNode()
 {
     $child = new Node();
     $child->setName('query');
     $node = new Node();
     $node->setName('iq');
     $node->setAttributes(["id" => 'getgroupinfo-', "type" => "get", "xmlns" => "w:g", "to" => Identity::createJID($this->getGroupId())]);
     $node->addChild($child);
     return $node;
 }
Beispiel #2
0
 /**
  * @return Node
  */
 public function createNode()
 {
     $listNode = new Node();
     $listNode->setName('list');
     $listNode->setAttribute('type', $this->getType());
     $node = new Node();
     $node->setName('iq');
     $node->setAttributes(["id" => 'getgroups-', "type" => "get", "xmlns" => "w:g", "to" => "g.us"]);
     $node->addChild($listNode);
     return $node;
 }
Beispiel #3
0
 /**
  * @return Node
  */
 public function createNode()
 {
     $node = new Node();
     $node->setName('iq')->setAttribute('type', 'set')->setAttribute('to', "s.whatsapp.net")->setAttribute('id', null)->setAttribute('xmlns', 'urn:xmpp:whatsapp:dirty');
     foreach ($this->getCategories() as $category) {
         $categoryNode = new Node();
         $categoryNode->setName('clean')->setAttribute('type', $category);
         $node->addChild($categoryNode);
     }
     return $node;
 }
Beispiel #4
0
 /**
  * @return Node
  */
 public function createNode()
 {
     $syncNode = new Node();
     $syncNode->setName('sync');
     $syncNode->setAttributes(["mode" => $this->getMode(), "context" => $this->getContext(), "sid" => "" . (time() + 11644477200) * 10000000, "index" => "" . $this->getIndex(), "last" => $this->isLast() ? "true" : "false"]);
     foreach ($this->getNumbers() as $number) {
         $userNode = new Node();
         $userNode->setName('user')->setData($number);
         $syncNode->addChild($userNode);
     }
     $node = new Node();
     $node->setName('iq');
     $node->setAttributes(["id" => 'sendsync-', "type" => "get", "xmlns" => "urn:xmpp:whatsapp:sync", "to" => Identity::createJID($this->getTo())]);
     $node->addChild($syncNode);
     return $node;
 }