/****************CHAT********************/ case 'chatheartbeat': try{ $chatHistory=Session::getInstance()->getItem('chatHistory'); $openChatBoxes=Session::getInstance()->getItem('openChatBoxes'); $this->gchat->chatHeartbeat($openChatBoxes,$chatHistory,$this->usuario->getCuenta()); Session::getInstance()->addItem('chatHistory',$chatHistory); Session::getInstance()->addItem('openChatBoxes',$openChatBoxes); die(); }catch(Exception $e){ $contenido=$this->gui->getMensajeError($e->getMessage(),$this->lastEvento); } break; case 'sendchat': try{ $chatHistory=Session::getInstance()->getItem('chatHistory'); $openChatBoxes=Session::getInstance()->getItem('openChatBoxes'); $message=$evento->getParametro('message'); $to=$evento->getParametro('to'); $this->gchat->sendChat($openChatBoxes,$chatHistory,$this->usuario->getCuenta(),$message,$to); Session::getInstance()->addItem('chatHistory',$chatHistory); Session::getInstance()->addItem('openChatBoxes',$openChatBoxes); die(); }catch(Exception $e){ $contenido=$this->gui->getMensajeError($e->getMessage(),$this->lastEvento); } break; case 'startchatsession': try{ $chatHistory=Session::getInstance()->getItem('chatHistory'); $openChatBoxes=Session::getInstance()->getItem('openChatBoxes'); if (!isset($chatHistory)) { $chatHistory = array(); } if (!isset($openChatBoxes)) { $openChatBoxes = array(); } $chatbox=$evento->getParametro('chatbox'); $this->gchat->startChatSession($chatHistory,$openChatBoxes,$this->usuario->getCuenta()); Session::getInstance()->addItem('chatHistory',$chatHistory); Session::getInstance()->addItem('openChatBoxes',$openChatBoxes); die(); }catch(Exception $e){ $contenido=$this->gui->getMensajeError($e->getMessage(),$this->lastEvento); } break; case 'closechat': try{ /* $chatHistory=Session::getInstance()->getItem('chatHistory'); $openChatBoxes=Session::getInstance()->getItem('openChatBoxes'); if (!isset($chatHistory)) { $chatHistory = array(); } if (!isset($openChatBoxes)) { $openChatBoxes = array(); } $chatbox=$evento->getParametro('chatbox'); $this->gchat->closeChat($openChatBoxes,$chatbox); */ echo 1; Session::getInstance()->delItem('chatHistory'); Session::getInstance()->delItem('openChatBoxes'); die(); }catch(Exception $e){ $contenido=$this->gui->getMensajeError($e->getMessage(),$this->lastEvento); } break; case 'listchat': try{ die(); }catch(Exception $e){ $contenido=$this->gui->getMensajeError($e->getMessage(),$this->lastEvento); } break; /*********************FIN CHAT**********************/