Example #1
0
             $USER->Browsers[0]->SetStatus(CHAT_STATUS_ACTIVE);
         }
         $action = $USER->Browsers[0]->GetMaxWaitingTimeAction(false);
         if ($action == "MESSAGE" || $action == "FORWARD" && !$USER->Browsers[0]->CreateAutoForward($USER)) {
             $USER->AddFunctionCall("lz_chat_set_talk_to_human(false,false);lz_mode_create_ticket=true;", false);
             $USER->Browsers[0]->InternalDecline(Server::$Operators[$USER->Browsers[0]->OperatorId]->SystemId);
         }
     } else {
         $OVERLAY->IsChatAvailable = $OVERLAY->OperatorCount > 0;
     }
 }
 if (!$OVERLAY->IsChatAvailable) {
     $USER->AddFunctionCall("lz_chat_set_connecting(false,'" . $USER->Browsers[0]->SystemId . "',false,null,0);", false);
     $OVERLAY->SetHost(null);
 }
 $OVERLAY->ProcessPosts();
 $OVERLAY->Listen();
 if (!empty($USER->Browsers[0]->Forward) && !$USER->Browsers[0]->Forward->Invite && !empty($USER->Browsers[0]->Forward->TargetGroupId) && !$USER->Browsers[0]->Forward->Processed) {
     if (!$USER->Browsers[0]->Forward->Processed) {
         $USER->Browsers[0]->LeaveChat($USER->Browsers[0]->Forward->InitiatorSystemId);
         $USER->Browsers[0]->Forward->Save(true);
         $USER->Browsers[0]->ExternalClose();
         $USER->Browsers[0]->DesiredChatGroup = $USER->Browsers[0]->Forward->TargetGroupId;
         $USER->Browsers[0]->DesiredChatPartner = $USER->Browsers[0]->Forward->TargetSessId;
         $USER->Browsers[0]->FirstActive = time();
         $USER->Browsers[0]->Save(true);
         $USER->Browsers[0]->SetCookieGroup();
         $OVERLAY->SetHost(null);
     }
     if (!empty(Server::$Operators[$USER->Browsers[0]->Forward->SenderSystemId]) && $USER->Browsers[0]->InternalActivation) {
         if (!empty($USER->Browsers[0]->OperatorId) && Server::$Operators[$USER->Browsers[0]->OperatorId]->IsBot) {