function onPresence($packet) { $contacts = $packet->content; if ($contacts != null) { $cd = new \Modl\ContactDAO(); $contact = $contacts[0]; /* if($c->groupname == '') $c->groupname = $this->__('roster.ungrouped'); else{ $c->groupname = htmlspecialchars_decode($c->groupname); } $c->rostername = htmlspecialchars_decode($c->rostername); $ac = $c->toRoster(); $this->prepareContact($ac, $c, $this->getCaps()); $c = $ac; RPC::call('updateContact', json_encode($c));*/ $html = $this->prepareItem($cd->getRoster($contact->jid)[0]); if ($html) { RPC::call('MovimTpl.replace', '#' . cleanupId($contact->jid), $html); } } }
private function setState($array, $message) { list($from, $to) = $array; if ($from == $this->user->getLogin()) { $jid = $to; } else { $jid = $from; } $view = $this->tpl(); $view->assign('message', $message); $html = $view->draw('_chat_state', true); RPC::call('MovimTpl.fill', '#' . cleanupId($jid . '_state'), $html); }
function ajaxClose($jid) { if (!$this->validateJid($jid)) { return; } $chats = Cache::c('chats'); unset($chats[$jid]); Cache::c('chats', $chats); RPC::call('MovimTpl.remove', '#' . cleanupId($jid . '_chat_item')); RPC::call('Chats.refresh'); RPC::call('Chat.empty'); RPC::call('MovimTpl.hidePanel'); }