function ajaxAccept($jid) { $jid = echapJid($jid); $rd = new \Modl\RosterLinkDAO(); $c = $rd->get($jid); if (isset($c) && $c->groupname) { $ui = new UpdateItem(); $ui->setTo($jid)->setFrom($this->user->getLogin())->setName($c->rostername)->setGroup($c->groupname)->request(); } else { $r = new AddItem(); $r->setTo($jid)->setFrom($this->user->getLogin())->request(); } $p = new Subscribe(); $p->setTo($jid)->request(); $p = new Subscribed(); $p->setTo($jid)->request(); // TODO : move in Moxl $notifs = Cache::c('activenotifs'); unset($notifs[$jid]); Cache::c('activenotifs', $notifs); }
function ajaxAccept($jid) { $jid = echapJid($jid); $rd = new \Modl\RosterLinkDAO(); $c = $rd->get($jid); if (isset($c) && $c->groupname) { $ui = new UpdateItem(); $ui->setTo($jid)->setFrom($this->user->getLogin())->setName($c->rostername)->setGroup($c->groupname)->request(); } else { $r = new AddItem(); $r->setTo($jid)->setFrom($this->user->getLogin())->request(); } $p = new Subscribe(); $p->setTo($jid)->request(); $p = new Subscribed(); $p->setTo($jid)->request(); // TODO : move in Moxl $session = \Session::start(); $notifs = $session->get('activenotifs'); unset($notifs[$jid]); $session->set('activenotifs', $notifs); Notification::ajaxClear('invite|' . $jid); }
/** * @brief Add a contact to the roster and subscribe */ function ajaxAdd($form) { $jid = $form['searchjid']; $r = new AddItem(); $r->setTo($jid)->setFrom($this->user->getLogin())->request(); $p = new Subscribe(); $p->setTo($jid)->request(); }