Remove references to Chat-Call in global chat #1480

pull/2487/head
Angel Fernando Quiroz Campos 9 years ago
parent 5a145fedab
commit 2035d8595c
  1. 1
      main/inc/ajax/course_chat.ajax.php
  2. 37
      main/inc/lib/CourseChatUtils.php
  3. 6
      main/template/default/chat/chat.tpl

@ -33,7 +33,6 @@ switch ($_REQUEST['action']) {
$json = [
'status' => true,
'data' => [
'chatIsDenied' => $courseChatUtils->isChatDenied(),
'oldFileSize' => file_exists($filePath) ? filesize($filePath) : 0,
'history' => $newFileSize !== $oldFileSize ? $courseChatUtils->readMessages(false, $friend) : null,
'usersOnline' => $newUsersOnline,

@ -331,43 +331,6 @@ class CourseChatUtils
$em->flush();
}
/**
* Check if the connection is denied for chat
* @return bool
* @throws \Doctrine\ORM\ORMException
* @throws \Doctrine\ORM\OptimisticLockException
* @throws \Doctrine\ORM\TransactionRequiredException
*/
public function isChatDenied()
{
if (ChamiloSession::read('origin', null) !== 'whoisonline') {
return false;
}
$talkTo = ChamiloSession::read('target', 0);
if (!$talkTo) {
return true;
}
$em = Database::getManager();
$user = $em->find('ChamiloUserBundle:User', $talkTo);
if ($user->getChatcallText() === 'DENIED') {
$user
->setChatcallDate(null)
->setChatcallUserId(null)
->setChatcallText(null);
$em->merge($user);
$em->flush();
return true;
}
return false;
}
/**
* Get the emoji allowed on course chat
* @return array

@ -78,12 +78,6 @@
friend: ChChat.currentFriend
})
.done(function (response) {
if (response.data.chatIsDenied) {
alert("{{ 'ChatDenied'|get_lang }}");
return;
}
if (response.data.history) {
ChChat._historySize = response.data.oldFileSize;
ChChat.setHistory(response.data.history);

Loading…
Cancel
Save