예제 #1
0
파일: Roster.php 프로젝트: movim/moxl
 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();
     }
 }
예제 #2
0
파일: RemoveItem.php 프로젝트: movim/moxl
 public function handle($stanza, $parent = false)
 {
     $rd = new \Modl\RosterLinkDAO();
     $rd->delete($this->_to);
     $this->pack($this->_to);
     $this->deliver();
 }