|
|
|
@ -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 |
|
|
|
|