public function handle($stanza, $parent = false) { $sd = new \Modl\SubscriptionDAO(); $sd->deleteNode($this->_to, $this->_node); $this->pack(['server' => $this->_to, 'node' => $this->_node]); $this->deliver(); }
public function error($stanza, $parent = false) { //delete from bookmark $sd = new \Modl\SubscriptionDAO(); $sd->deleteNode($this->_to, $this->_node); //delete from item $id = new \Modl\ItemDAO(); $id->deleteItem($this->_to, $this->_node); $this->pack(array('server' => $this->_to, 'node' => $this->_node)); $this->deliver(); }
public function handle($stanza, $parent = false) { $jid = current(explode('/', (string) $stanza->attributes()->to)); $server = $this->_to; $node = $this->_node; $tab = []; foreach ($stanza->pubsub->subscriptions->children() as $s) { $su = new \Modl\Subscription(); $su->set($jid, $server, $node, $s); $sd = new \Modl\SubscriptionDAO(); $sd->set($su); $sub = ['jid' => (string) $s["jid"], 'subscription' => (string) $s["subscription"], 'subid' => (string) $s["subid"]]; array_push($tab, $sub); } if (empty($tab)) { $sd = new \Modl\SubscriptionDAO(); $sd->deleteNode($server, $node); } $this->pack(['subscriptions' => $tab, 'to' => $this->_to, 'node' => $this->_node]); if ($this->_notify) { $this->deliver(); } }