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; $c->photobin = (string) $stanza->pubsub->items->item->data; $c->createThumbnails(); $cd->set($c); $this->pack($c); $this->deliver(); }
public function handle($stanza, $parent = false) { $jid = current(explode('/', (string) $parent->attributes()->from)); $evt = new \Event(); $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); $evt->runEvent('vcard', $c); }
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); } }
public function handle($stanza, $parent = false) { if ($stanza->attributes()->from) { $jid = current(explode('/', (string) $stanza->attributes()->from)); } else { $jid = $this->_to; } if ($jid) { $evt = new \Event(); $cd = new \modl\ContactDAO(); $c = $cd->get($this->_to); if ($c == null) { $c = new \modl\Contact(); } $c->set($stanza, $this->_to); $cd->set($c); $c->createThumbnails(); $this->pack($c); $this->deliver(); } }