public function handle($stanza, $parent = false) { $to = current(explode('/', (string) $stanza->attributes()->to)); $from = $this->_to; $node = $this->_node; if ($stanza->pubsub->items->item) { $post = false; foreach ($stanza->pubsub->items->item as $item) { if (isset($item->entry) && (string) $item->entry->attributes()->xmlns == 'http://www.w3.org/2005/Atom') { $p = new \Modl\Postn(); $promise = $p->set($item, $from, false, $node); $promise->done(function () use($p) { $pd = new \Modl\PostnDAO(); $pd->set($p); $post = true; if (is_array($this->_askreply)) { $this->pack(['origin' => $this->_askreply['origin'], 'node' => $this->_askreply['node'], 'nodeid' => $this->_askreply['nodeid']]); $this->deliver(); } else { $this->pack($p); $this->event('post', $this->packet); } $this->pack(['server' => $this->_to, 'node' => $this->_node]); $this->deliver(); }); } } } else { $pd = new PostDelete(); $pd->setTo($this->_to)->setNode($this->_node)->setId($this->_id); $pd->handle($stanza); } }
function ajaxDeleteConfirm($to, $node, $id) { $p = new PostDelete(); $p->setTo($to)->setNode($node)->setId($id)->request(); }
function ajaxDeleteConfirm($to, $node, $id) { $p = new PostDelete(); $p->setTo($to)->setNode($node)->setId($id)->request(); $p = new Delete(); $p->setTo($to)->setNode('urn:xmpp:microblog:0:comments/' . $id)->request(); }