feat: enhance chat functionality with new conversation and meeting room features
- Added support for creating and managing group conversations and meeting rooms, allowing users to initiate discussions with multiple participants. - Implemented a modal for creating new conversations, including options for individual, group, and meeting room types. - Enhanced the chat list component to filter and display conversations based on type, improving user navigation. - Introduced admin functionalities for meeting rooms, enabling user management and role assignments within the chat interface. - Updated backend schema and API to accommodate new conversation types and related operations, ensuring robust data handling.
This commit is contained in:
@@ -727,12 +727,12 @@
|
||||
"enviando",
|
||||
"Criando/buscando conversa...",
|
||||
);
|
||||
const conversaResult = await client.mutation(
|
||||
const conversaId = await client.mutation(
|
||||
api.chat.criarOuBuscarConversaIndividual,
|
||||
{ outroUsuarioId: destinatario._id as Id<"usuarios"> },
|
||||
);
|
||||
|
||||
if (conversaResult.conversaId) {
|
||||
if (conversaId) {
|
||||
const mensagem = usarTemplate
|
||||
? templateSelecionado?.corpo || ""
|
||||
: mensagemPersonalizada;
|
||||
@@ -748,7 +748,7 @@
|
||||
resultadoChat = await client.mutation(
|
||||
api.chat.agendarMensagem,
|
||||
{
|
||||
conversaId: conversaResult.conversaId,
|
||||
conversaId: conversaId,
|
||||
conteudo: mensagem,
|
||||
agendadaPara: agendadaPara,
|
||||
},
|
||||
@@ -773,7 +773,7 @@
|
||||
"Enviando mensagem...",
|
||||
);
|
||||
resultadoChat = await client.mutation(api.chat.enviarMensagem, {
|
||||
conversaId: conversaResult.conversaId,
|
||||
conversaId: conversaId,
|
||||
conteudo: mensagem,
|
||||
tipo: "texto",
|
||||
permitirNotificacaoParaSiMesmo: true,
|
||||
@@ -982,12 +982,12 @@
|
||||
"enviando",
|
||||
"Processando...",
|
||||
);
|
||||
const conversaResult = await client.mutation(
|
||||
const conversaId = await client.mutation(
|
||||
api.chat.criarOuBuscarConversaIndividual,
|
||||
{ outroUsuarioId: destinatario._id as Id<"usuarios"> },
|
||||
);
|
||||
|
||||
if (conversaResult.conversaId) {
|
||||
if (conversaId) {
|
||||
// Para templates, usar corpo direto (o backend já faz substituição via email)
|
||||
// Para mensagem personalizada, usar diretamente
|
||||
const mensagem = usarTemplate
|
||||
@@ -996,7 +996,7 @@
|
||||
|
||||
if (agendadaPara) {
|
||||
await client.mutation(api.chat.agendarMensagem, {
|
||||
conversaId: conversaResult.conversaId,
|
||||
conversaId: conversaId,
|
||||
conteudo: mensagem,
|
||||
agendadaPara: agendadaPara,
|
||||
});
|
||||
@@ -1013,7 +1013,7 @@
|
||||
);
|
||||
} else {
|
||||
await client.mutation(api.chat.enviarMensagem, {
|
||||
conversaId: conversaResult.conversaId,
|
||||
conversaId: conversaId,
|
||||
conteudo: mensagem,
|
||||
tipo: "texto",
|
||||
permitirNotificacaoParaSiMesmo: true,
|
||||
|
||||
Reference in New Issue
Block a user