示例#1
0
文件: Notifs.php 项目: Nyco/movim
 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);
 }
示例#2
0
文件: Notifs.php 项目: Anon215/movim
 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);
 }
示例#3
0
文件: Roster.php 项目: Nyco/movim
 /**
  * @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();
 }