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); }
function ajaxEditSubmit($form) { $rd = new UpdateItem(); $rd->setTo(echapJid($form->jid->value))->setFrom($this->user->getLogin())->setName($form->alias->value)->setGroup($form->group->value)->request(); }