public function handle($stanza, $parent = false) { $nd = new \Modl\ItemDAO(); $jid = null; foreach ($stanza->query->item as $item) { $n = $nd->getItem($this->_to, (string) $item->attributes()->node); if (!$n) { $n = new \modl\Item(); } $n->set($item, $this->_to); if (substr($n->node, 0, 29) != 'urn:xmpp:microblog:0:comments') { $nd->set($n, true); } if ($jid != $n->jid) { if (isset($n->node)) { $r = new Request(); $r->setTo($n->jid)->setNode($n->node)->request(); } $r = new Request(); $r->setTo($n->jid)->request(); } $jid = $n->jid; } $this->pack($this->_to); $this->deliver(); }
public function handle($stanza, $parent = false) { $evt = new \Event(); $tab = array(); $nd = new \modl\ItemDAO(); $n = new \modl\Item(); $n->setMetadata($stanza->query->x, $this->_to, $this->_node); $nd->set($n); $evt->runEvent('pubsubmetadata', array($this->_to, $this->_node)); }
public function handle($stanza, $parent = false) { $id = new \modl\ItemDAO(); $i = $id->getItem($this->_to, $this->_node); if (!$i) { $i = new \modl\Item(); } if (isset($stanza->query->x)) { $i->setMetadata($stanza->query->x, $this->_to, $this->_node); } $id->set($i); $this->pack([$this->_to, $this->_node]); $this->deliver(); }