public function handle($stanza, $parent = false) { $type = (string) $stanza->data->attributes()->type; $data = (string) $stanza->data; $p = new Picture(); $p->fromBase($data); $p->set($this->_cid, 'png'); $this->pack(['to' => $this->_to, 'cid' => $this->_cid]); $this->deliver(); }
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(); } $p = new Picture(); $p->fromBase((string) $stanza->items->item->data); $p->set($jid); $this->event('vcard', $c); }