public function handle($stanza, $parent = false) { $node = $stanza->attributes()->node . '#' . $stanza->attributes()->ver; $to = (string) $parent->attributes()->from; $cd = new \modl\CapsDAO(); $c = $cd->get($node); if (!$c && $parent->getName() != 'streamfeatures') { $d = new Request(); $d->setTo($to)->setNode($node)->request(); } }
/** * @brief Reload the user configuration */ function reload() { $session = \Sessionx::start(); if ($session->config) { $this->config = $session->config; $lang = $this->getConfig('language'); if (isset($lang)) { loadLanguage($lang); } $cd = new modl\CapsDAO(); $caps = $cd->get($session->host); $this->caps = unserialize($caps->features); } }
public function handle($stanza, $parent = false) { $c = new \modl\Caps(); if (isset($this->_node)) { $c->set($stanza, $this->_node); } else { $c->set($stanza, $this->_to); } if ($c->node != '' && $c->category != '' && $c->type != '' && $c->name != '') { $cd = new \modl\CapsDAO(); $cd->set($c); $this->pack($c); $this->deliver(); } }
/** * @brief Reload the user configuration */ function reload($language = false) { $session = \Sessionx::start(); if ($session->config) { if ($language) { $this->config = $session->config; $lang = $this->getConfig('language'); if (isset($lang)) { $l = Movim\i18n\Locale::start(); $l->load($lang); } } $cd = new modl\CapsDAO(); $caps = $cd->get($session->host); $this->caps = unserialize($caps->features); } }
function display() { $cd = new \modl\CapsDAO(); $clients = $cd->getClients(); foreach ($clients as $c) { if (!isset($this->_table[$c->name])) { $this->_table[$c->name] = array(); } $features = unserialize($c->features); foreach ($features as $f) { if (!in_array($f, $this->_table[$c->name])) { array_push($this->_table[$c->name], (string) $f); } } } ksort($this->_table); $this->_nslist = getXepNamespace(); $this->view->assign('table', $this->_table); $this->view->assign('nslist', $this->_nslist); }
function prepareChat($jid, $status = null) { if (!$this->validateJid($jid)) { return; } $view = $this->tpl(); $cd = new \Modl\ContactDAO(); $md = new \modl\MessageDAO(); $cad = new \modl\CapsDAO(); $presencestxt = getPresencesTxt(); $cr = $cd->getRosterItem($jid); if (isset($cr)) { if ($cr->value != null) { $view->assign('presence', $presencestxt[$cr->value]); } $view->assign('contact', $cr); $view->assign('caps', $cad->get($cr->node . '#' . $cr->ver)); } else { $view->assign('contact', $cd->get($jid)); $view->assign('caps', null); } $view->assign('status', $status); $m = $md->getContact($jid, 0, 1); if (isset($m)) { $view->assign('message', $m[0]); } return $view->draw('_chats_item', true); }