function ajaxEditContact($jid) { if (!$this->validateJid($jid)) { return; } $rd = new \Modl\RosterLinkDAO(); $groups = $rd->getGroups(); $rl = $rd->get($jid); $view = $this->tpl(); if (isset($rl)) { $view->assign('submit', $this->call('ajaxEditSubmit', "movim_form_to_json('manage')")); $view->assign('contact', $rl); $view->assign('groups', $groups); } Dialog::fill($view->draw('_contact_edit', true)); }
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); }