Example #1
0
 public function handle($stanza, $parent = false)
 {
     $rd = new \modl\RosterLinkDAO();
     $rd->delete($this->_to);
     $this->pack($this->_to);
     $this->deliver();
 }
Example #2
0
 public function handle($stanza, $parent = false)
 {
     if ((string) $parent->attributes()->type == 'set') {
         $rd = new \modl\RosterLinkDAO();
         $jid = current(explode('/', (string) $parent->query->item->attributes()->jid));
         if ((string) $parent->query->item->attributes()->subscription == 'remove') {
             $rd->delete($jid);
         } else {
             $from = current(explode('/', (string) $parent->attributes()->from));
             $name = (string) $parent->query->item->attributes()->name;
             $subscription = (string) $parent->query->item->attributes()->subscription;
             $group = (string) $parent->query->item->group;
             // If not found, we create it
             $r = new \modl\RosterLink();
             $r->key = $from;
             $r->jid = $jid;
             $r->groupname = $group;
             $r->rostername = $name;
             $r->rostersubscription = $subscription;
             $rd->delete($jid);
             $rd->set($r);
         }
         $this->deliver();
     }
 }
Example #3
0
 public function handle($stanza, $parent = false)
 {
     $r = new \modl\RosterLink();
     $r->key = $this->_from;
     $r->jid = $this->_to;
     $rd = new \modl\RosterLinkDAO();
     $rd->setNow($r);
     $cd = new \Modl\ContactDAO();
     $c = $cd->getRosterItem($this->_to, true);
     $this->deliver();
 }
Example #4
0
 public function handle($stanza, $parent = false)
 {
     $r = new \modl\RosterLink();
     $r->session = $this->_from;
     $r->jid = $this->_to;
     $r->rostername = $this->_name;
     $r->groupname = $this->_group;
     $rd = new \modl\RosterLinkDAO();
     $rd->update($r);
     $cd = new \Modl\ContactDAO();
     $c = $cd->getRosterItem($this->_to, true);
     $this->pack($c);
     $this->deliver();
 }
Example #5
0
 public function handle($stanza, $parent = false)
 {
     $evt = new \Event();
     $rd = new \modl\RosterLinkDAO();
     $list = array();
     foreach ($stanza->query->item as $item) {
         $r = new \modl\RosterLink();
         $r->set($item);
         array_push($list, $r);
     }
     $rd->clearRosterLink();
     if (!empty($list)) {
         $rd->setList($list);
     }
     $this->deliver();
 }
Example #6
0
 function ajaxClearRosterLink()
 {
     $rd = new \modl\RosterLinkDAO();
     $rd->clearRosterLink();
     $this->refresh();
 }