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); }
function onSessionInitiate($jingle) { $jts = new \JingletoSDP($jingle); $sdp = $jts->generate(); $cd = new \Modl\ContactDAO(); $contact = $cd->get(cleanJid((string) $jingle->attributes()->initiator)); if (!isset($contact)) { $contact = new Modl\Contact(); } if ($sdp) { RPC::call('movim_desktop_notification', $contact->getTrueName(), $this->__('visio.calling'), $contact->getPhoto('m')); //RPC::call('Popup.setJid', (string)$jingle->attributes()->initiator); RPC::call('onOffer', $sdp); } }
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(); } }