static function setConfig($to, $data) { $dom = new \DOMDocument('1.0', 'UTF-8'); $query = $dom->createElementNS('http://jabber.org/protocol/muc#owner', 'query'); $dom->appendChild($query); $x = $dom->createElementNS('jabber:x:data', 'x'); $x->setAttribute('type', 'submit'); $query->appendChild($x); $xmpp = new \FormtoXMPP($data); $xmpp->create(); $xmpp->appendToX($dom); $xml = \Moxl\API::iqWrapper($query, $to, 'set'); \Moxl\API::request($xml); }
static function submit($to, $node, $data, $sessionid) { $dom = new \DOMDocument('1.0', 'UTF-8'); $command = $dom->createElementNS('http://jabber.org/protocol/commands', 'command'); $dom->appendChild($command); $command->setAttribute('sessionid', $sessionid); $command->setAttribute('node', $node); $x = $dom->createElementNS('jabber:x:data', 'x'); $x->setAttribute('type', 'submit'); $command->appendChild($x); $xmpp = new \FormtoXMPP($data); $xmpp->create(); $xmpp->appendToX($dom); $xml = \Moxl\API::iqWrapper($command, $to, 'set'); \Moxl\API::request($xml); }
static function setConfig($to, $node, $data) { $dom = new \DOMDocument('1.0', 'UTF-8'); $pubsub = $dom->createElementNS('http://jabber.org/protocol/pubsub#owner', 'pubsub'); $dom->appendChild($pubsub); $configure = $dom->createElement('configure'); $configure->setAttribute('node', $node); $pubsub->appendChild($configure); $x = $dom->createElementNS('jabber:x:data', 'x'); $x->setAttribute('type', 'submit'); $configure->appendChild($x); $xmpp = new \FormtoXMPP($data); $xmpp->create(); $xmpp->appendToX($dom); $xml = \Moxl\API::iqWrapper($pubsub, $to, 'set'); \Moxl\API::request($xml); }