|
@@ -35,6 +35,7 @@ if (!isset($_SESSION['openChatBoxes'])) {
|
|
|
}
|
|
|
|
|
|
$chat = new Chat();
|
|
|
+
|
|
|
if (Chat::disableChat()) {
|
|
|
exit;
|
|
|
}
|
|
@@ -43,6 +44,7 @@ if ($chat->isChatBlockedByExercises()) {
|
|
|
$chat->setUserStatus(0);
|
|
|
exit;
|
|
|
}
|
|
|
+
|
|
|
switch ($action) {
|
|
|
case 'chatheartbeat':
|
|
|
$chat->heartbeat();
|
|
@@ -57,7 +59,7 @@ switch ($action) {
|
|
|
$chat->startSession();
|
|
|
break;
|
|
|
case 'get_previous_messages':
|
|
|
- $userId = isset($_REQUEST['user_id']) ? $_REQUEST['user_id'] : null;
|
|
|
+ $userId = isset($_REQUEST['user_id']) ? $_REQUEST['user_id'] : 0;
|
|
|
$visibleMessages = isset($_REQUEST['visible_messages']) ? $_REQUEST['visible_messages'] : null;
|
|
|
if (empty($userId)) {
|
|
|
return '';
|