Browse Source

Minor - format code

jmontoyaa 7 years ago
parent
commit
9746970b43
2 changed files with 5 additions and 3 deletions
  1. 3 1
      main/inc/ajax/chat.ajax.php
  2. 2 2
      main/inc/lib/chat.lib.php

+ 3 - 1
main/inc/ajax/chat.ajax.php

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

+ 2 - 2
main/inc/lib/chat.lib.php

@@ -349,12 +349,12 @@ class Chat extends Model
         $printResult = true,
         $sanitize = true
     ) {
-        $user_friend_relation = SocialManager::get_relation_between_contacts(
+        $relation = SocialManager::get_relation_between_contacts(
             $fromUserId,
             $to_user_id
         );
 
-        if ($user_friend_relation == USER_RELATION_TYPE_FRIEND) {
+        if ($relation == USER_RELATION_TYPE_FRIEND) {
             $now = api_get_utc_datetime();
             $user_info = api_get_user_info($to_user_id, true);
             $this->saveWindow($to_user_id);