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(); } }