Пример #1
0
 /**
  * @brief Get a discussion
  * @param string $jid
  */
 function ajaxGet($jid = null)
 {
     if ($jid == null) {
         RPC::call('movim_fill', 'chat_widget', $this->prepareEmpty());
     } else {
         $chats = new Chats();
         $chats->ajaxGetHistory($jid);
         $html = $this->prepareChat($jid);
         $header = $this->prepareHeader($jid);
         Header::fill($header);
         RPC::call('movim_fill', 'chat_widget', $html);
         RPC::call('MovimTpl.scrollPanel');
         RPC::call('MovimTpl.showPanel');
         $this->prepareMessages($jid);
     }
 }
Пример #2
0
 /**
  * @brief Get a discussion
  * @param string $jid
  */
 function ajaxGet($jid = null)
 {
     if ($jid == null) {
         RPC::call('MovimUtils.pushState', $this->route('chat'));
         RPC::call('MovimUtils.removeClass', '#chat_widget', 'fixed');
         RPC::call('MovimTpl.fill', '#chat_widget', $this->prepareEmpty());
     } else {
         $chats = new Chats();
         $chats->ajaxGetHistory($jid);
         $notif = new Notification();
         $notif->ajaxClear('chat|' . $jid);
         $html = $this->prepareChat($jid);
         RPC::call('MovimUtils.pushState', $this->route('chat', $jid));
         RPC::call('MovimUtils.addClass', '#chat_widget', 'fixed');
         RPC::call('MovimTpl.fill', '#chat_widget', $html);
         RPC::call('MovimTpl.showPanel');
         RPC::call('Chat.focus');
         $this->prepareMessages($jid);
     }
 }