public function handle($stanza, $parent = false) { $sd = new \modl\SubscriptionDAO(); $cd = new \modl\ConferenceDAO(); // We clear the old Bookmarks $sd->delete(); $cd->delete(); // We save the bookmarks as Subscriptions in the database foreach ($this->_arr as $c) { if ($c['type'] == 'subscription') { $su = new \modl\Subscription(); $su->jid = $this->_to; $su->server = (string) $c['server']; $su->node = (string) $c['node']; $su->subscription = 'subscribed'; $su->subid = (string) $c['subid']; $sd->set($su); } elseif ($c['type'] == 'conference') { $co = new \modl\Conference(); $co->jid = $this->_to; $co->conference = (string) $c['jid']; $co->name = (string) $c['name']; $co->nick = (string) $c['nick']; $co->autojoin = (int) $c['autojoin']; $co->status = 0; $cd->set($co); } } $this->deliver(); }
public function handle($stanza, $parent = false) { if ($stanza->pubsub->items->item->storage) { $sd = new \modl\SubscriptionDAO(); $cd = new \modl\ConferenceDAO(); // We clear the old Bookmarks $sd->delete(); $cd->delete(); if ($stanza->pubsub->items->item->count() == 1) { // We save the bookmarks as Subscriptions in the database foreach ($stanza->pubsub->items->item->storage->children() as $c) { $this->saveItem($c); } } else { // We parse non-standard XML where the items are in many <item> foreach ($stanza->pubsub->items->children() as $c) { foreach ($c->storage->children() as $s) { $this->saveItem($s); } } } $this->deliver(); } }
function prepareRooms($edit = false) { $view = $this->tpl(); $cod = new \modl\ConferenceDAO(); $list = $cod->getAll(); $connected = []; if (is_array($list)) { foreach ($list as $key => $room) { if ($this->checkConnected($room->conference, $room->nick)) { $room->connected = true; array_push($connected, $room); unset($list[$key]); } } $connected = array_merge($connected, $list); } $view->assign('edit', $edit); $view->assign('conferences', $connected); $view->assign('room', $this->get('r')); return $view->draw('_rooms', true); }
function prepareRooms() { $view = $this->tpl(); $cod = new \modl\ConferenceDAO(); $view->assign('conferences', $cod->getAll()); $view->assign('room', $this->get('r')); return $view->draw('_rooms', true); }
function ajaxBookmarkMucRemove($jid) { $cd = new \modl\ConferenceDAO(); $cd->deleteNode($jid); $this->ajaxSetBookmark(); }