diff --git a/main/api/app/Controllers/AiChatController.php b/main/api/app/Controllers/AiChatController.php index 6dbf89d..af0eb13 100644 --- a/main/api/app/Controllers/AiChatController.php +++ b/main/api/app/Controllers/AiChatController.php @@ -106,6 +106,7 @@ public function sendMessage(Request $request, Response $response, array $args): $newMessage = $this->addMessageToConversation($conversationId, $text, $authorId); if ($newMessage) { + $newMessage['text'] = html_entity_decode($newMessage['text']); $response->getBody()->write(json_encode($newMessage)); } else { return $this->notFoundResponse($response); @@ -191,10 +192,11 @@ public function updateMessage(Request $request, Response $response, array $args) } private function fetchConversations($get_newest_one = false) { + global $current_user; $conversations = []; $conversation_beans = $get_newest_one - ? BeanFactory::getBean('ev_AiConversations')->get_full_list('date_entered DESC', '', '', 1) - : BeanFactory::getBean('ev_AiConversations')->get_full_list('date_entered DESC'); + ? BeanFactory::getBean('ev_AiConversations')->get_full_list('date_entered DESC', "user_id = '$current_user->id'", '', 1) + : BeanFactory::getBean('ev_AiConversations')->get_full_list('date_entered DESC', "user_id = '$current_user->id'"); foreach ($conversation_beans as $bean) { if (empty($bean->id)) { continue; diff --git a/main/manifest.php b/main/manifest.php index 64d8cb9..c0066b1 100644 --- a/main/manifest.php +++ b/main/manifest.php @@ -12,7 +12,7 @@ 'name' => 'MintHCM - AI Agent', 'published_date' => '2024-09-30 12:00:00', 'type' => 'module', - 'version' => '4.1.0-1', + 'version' => '4.1.0-2', 'remove_tables' => 'prompt' ); $installdefs = array(