Пример #1
0
 /**
  * Send a ping to the server.
  *
  * @param string $to
  * @return void
  */
 public function ping($to)
 {
     $iq = new Iq(array('from' => $this->getFrom(), 'id' => uniqid(), 'to' => $to, 'type' => 'get'));
     $iq->initDom(new DOMElement('ping', null, 'urn:xmpp:ping'));
     $this->stream->send((string) $iq);
 }
Пример #2
0
 /**
  * @param string $type
  * @return Iq
  */
 protected function getIq($type = null)
 {
     $iq = new Iq($this->options);
     if (isset($type)) {
         $iq->setType($type);
     }
     return $iq;
 }