Update environment configuration for production, refactor WebRTC components, and enhance chat functionality. Replace deprecated SessionUsersPanel with SessionPage, integrate chat history loading, and improve audio/video toggle handling. Remove unused SessionUsersPanel2 component and update related socket event handling in the server.

This commit is contained in:
2025-10-27 16:49:52 +05:00
parent 95f7b90d38
commit 2378ed1ff4
20 changed files with 936 additions and 304 deletions
+38
View File
@@ -0,0 +1,38 @@
import { Elysia, t } from "elysia";
import { getChatHistory } from "../services/chat";
export const chatController = new Elysia({ prefix: "/sessions" })
.get(
"/:id/messages",
async ({ params, query }) => {
const { id } = params;
const limit = query.limit ? parseInt(query.limit) : 100;
try {
const messages = await getChatHistory(id, limit);
return {
success: true,
messages,
count: messages.length,
};
} catch (error) {
console.error("[Chat API] Error fetching chat history:", error);
return {
success: false,
error: "Failed to fetch chat history",
messages: [],
count: 0,
};
}
},
{
params: t.Object({
id: t.String(),
}),
query: t.Object({
limit: t.Optional(t.String()),
}),
}
);