Example #1
0
 public function handle($stanza, $parent = false)
 {
     $jid = current(explode('/', (string) $parent->attributes()->from));
     $cd = new \Modl\ContactDAO();
     $c = $cd->get($jid);
     if ($c == null) {
         $c = new \Modl\Contact();
     }
     $c->jid = $jid;
     $vcard = $stanza->items->item->vcard;
     $c->setVcard4($vcard);
     $c->createThumbnails();
     $cd->set($c);
     $this->event('vcard', $c);
 }
Example #2
0
File: Get.php Project: movim/moxl
 public function handle($stanza, $parent = false)
 {
     $cd = new \Modl\ContactDAO();
     $c = $cd->get($this->_to);
     if ($c == null) {
         $c = new \Modl\Contact();
     }
     $c->jid = $this->_to;
     if ($vcard = $stanza->pubsub->items->item) {
         $vcard = $stanza->pubsub->items->item->vcard;
         $c->setVcard4($vcard);
         $c->createThumbnails();
         $cd->set($c);
         $this->pack($c);
         $this->deliver();
     } else {
         $this->error(false);
     }
 }