feat: añadir menciones del creador y de asignados en notificaciones

Co-authored-by: aider (openrouter/openai/gpt-5) <aider@aider.chat>
pull/1/head
borja 2 months ago
parent 4a1baca559
commit 4f6f483a27

@ -155,6 +155,7 @@ export class CommandService {
// Resolver nombres útiles // Resolver nombres útiles
const creatorName = await ContactsService.getDisplayName(createdBy); const creatorName = await ContactsService.getDisplayName(createdBy);
const creatorJid = `${createdBy}@s.whatsapp.net`;
const groupName = groupIdToUse ? GroupSyncService.activeGroupsCache.get(groupIdToUse) : null; const groupName = groupIdToUse ? GroupSyncService.activeGroupsCache.get(groupIdToUse) : null;
const assignedDisplayNames = await Promise.all( const assignedDisplayNames = await Promise.all(
@ -175,7 +176,10 @@ export class CommandService {
`✅ Tarea ${taskId} creada:\n` + `✅ Tarea ${taskId} creada:\n` +
`${description || '(sin descripción)'}\n` + `${description || '(sin descripción)'}\n` +
(dueDate ? `• Vence: ${dueDate}\n` : '') + (dueDate ? `• Vence: ${dueDate}\n` : '') +
(assignedDisplayNames.length ? `• Asignados: ${assignedDisplayNames.join(', ')}` : '') (assignmentUserIds.length
? `• Asignados: ${assignmentUserIds.map((uid, idx) => `${assignedDisplayNames[idx] || uid} (@${uid})`).join(', ')}`
: ''),
mentions: mentionsForSending.length > 0 ? mentionsForSending : undefined
}); });
} }
@ -187,8 +191,9 @@ export class CommandService {
`🆕 Nueva tarea:\n` + `🆕 Nueva tarea:\n` +
`${description || '(sin descripción)'}\n` + `${description || '(sin descripción)'}\n` +
(dueDate ? `• Vence: ${dueDate}\n` : '') + (dueDate ? `• Vence: ${dueDate}\n` : '') +
`• Asignada por: ${creatorName || createdBy}` + `• Asignada por: ${creatorName || createdBy} (@${createdBy})` +
(groupName ? `\n• Grupo: ${groupName}` : '') (groupName ? `\n• Grupo: ${groupName}` : ''),
mentions: [creatorJid]
}); });
} }

Loading…
Cancel
Save